Skip to content

Commit 505d327

Browse files
networkInterfaces() fix uppercase iface names (linux)
1 parent 06e47be commit 505d327

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
9090

9191
| Version | Date | Comment |
9292
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
93+
| 5.30.5 | 2026-01-16 | `networkInterfaces()` fix uppercase iface names (linux) |
9394
| 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) |
9495
| 5.30.3 | 2026-01-11 | Updated docs, code cleanup |
9596
| 5.30.2 | 2026-01-08 | `processes()` revert added user (windows) |

docs/history.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ <h3>Full version history</h3>
5757
</tr>
5858
</thead>
5959
<tbody>
60+
<tr>
61+
<th scope="row">5.30.5
62+
</th>
63+
<td>2026-01-16</td>
64+
<td><span class="code">networkInterfaces()</span> fix uppercase support (linux)</td>
65+
</tr>
6066
<tr>
6167
<th scope="row">5.30.4
6268
</th>

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
<img class="logo" src="assets/logo.png" alt="logo">
171171
<div class="title">systeminformation</div>
172172
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
173-
<div class="version">New Version: <span id="version">5.30.4</span></div>
173+
<div class="version">New Version: <span id="version">5.30.5</span></div>
174174
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
175175
</div>
176176
<div class="down">
@@ -212,7 +212,7 @@
212212
<div class="title">Downloads last month</div>
213213
</div>
214214
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
215-
<div class="numbers">940</div>
215+
<div class="numbers">941</div>
216216
<div class="title">Dependents</div>
217217
</div>
218218
</div>

lib/network.js

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ function getWindowsNics() {
281281
function getWindowsDNSsuffixes() {
282282
let iface = {};
283283

284-
let dnsSuffixes = {
284+
const dnsSuffixes = {
285285
primaryDNS: '',
286286
exitCode: 0,
287287
ifaces: []
@@ -374,7 +374,7 @@ function getWindowsWirelessIfaceSSID(interfaceName) {
374374
}
375375
}
376376
function getWindowsIEEE8021x(connectionType, iface, ifaces) {
377-
let i8021x = {
377+
const i8021x = {
378378
state: 'Unknown',
379379
protocol: 'Unknown'
380380
};
@@ -947,7 +947,7 @@ function networkInterfaces(callback, rescan, defaultString) {
947947
ip6 = ip6link;
948948
ip6subnet = ip6linksubnet;
949949
}
950-
const iface = dev.split(':')[0].trim().toLowerCase();
950+
const iface = dev.split(':')[0].trim();
951951
let ifaceSanitized = '';
952952
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
953953
const l = util.mathMin(s.length, 2000);
@@ -1290,7 +1290,7 @@ function networkStats(ifaces, callback) {
12901290
Object.setPrototypeOf(ifaces, util.stringObj);
12911291
}
12921292

1293-
ifaces = ifaces.trim().toLowerCase().replace(/,+/g, '|');
1293+
ifaces = ifaces.trim().replace(/,+/g, '|');
12941294
ifacesArray = ifaces.split('|');
12951295
}
12961296

@@ -1334,11 +1334,11 @@ function networkStats(ifaces, callback) {
13341334

13351335
function networkStatsSingle(iface) {
13361336
function parseLinesWindowsPerfData(sections) {
1337-
let perfData = [];
1337+
const perfData = [];
13381338
for (let i in sections) {
13391339
if ({}.hasOwnProperty.call(sections, i)) {
13401340
if (sections[i].trim() !== '') {
1341-
let lines = sections[i].trim().split('\r\n');
1341+
const lines = sections[i].trim().split('\r\n');
13421342
perfData.push({
13431343
name: util
13441344
.getValue(lines, 'Name', ':')
@@ -1595,7 +1595,7 @@ function getProcessName(processes, pid) {
15951595
function networkConnections(callback) {
15961596
return new Promise((resolve) => {
15971597
process.nextTick(() => {
1598-
let result = [];
1598+
const result = [];
15991599
if (_linux || _freebsd || _openbsd || _netbsd) {
16001600
let cmd =
16011601
'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
@@ -1689,13 +1689,6 @@ function networkConnections(callback) {
16891689
}
16901690
}
16911691
}
1692-
// if (line.length >= 7 && line[6].indexOf('users:') > -1) {
1693-
// const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
1694-
// if (proc.length > 2) {
1695-
// process = proc[0].split(' ')[0].split(':')[0];
1696-
// pid = parseInt(proc[1], 10);
1697-
// }
1698-
// }
16991692
if (connstate) {
17001693
result.push({
17011694
protocol: line[0],
@@ -1806,7 +1799,7 @@ function networkConnections(callback) {
18061799
if (line.length >= 4) {
18071800
let localip = line[1];
18081801
let localport = '';
1809-
let localaddress = line[1].split(':');
1802+
const localaddress = line[1].split(':');
18101803
if (localaddress.length > 1) {
18111804
localport = localaddress[localaddress.length - 1];
18121805
localaddress.pop();
@@ -1815,14 +1808,14 @@ function networkConnections(callback) {
18151808
localip = localip.replace(/\[/g, '').replace(/\]/g, '');
18161809
let peerip = line[2];
18171810
let peerport = '';
1818-
let peeraddress = line[2].split(':');
1811+
const peeraddress = line[2].split(':');
18191812
if (peeraddress.length > 1) {
18201813
peerport = peeraddress[peeraddress.length - 1];
18211814
peeraddress.pop();
18221815
peerip = peeraddress.join(':');
18231816
}
18241817
peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
1825-
let pid = util.toInt(line[4]);
1818+
const pid = util.toInt(line[4]);
18261819
let connstate = line[3];
18271820
if (connstate === 'HERGESTELLT') {
18281821
connstate = 'ESTABLISHED';
@@ -1901,7 +1894,7 @@ function networkGatewayDefault(callback) {
19011894
process.nextTick(() => {
19021895
let result = '';
19031896
if (_linux || _freebsd || _openbsd || _netbsd) {
1904-
let cmd = 'ip route get 1';
1897+
const cmd = 'ip route get 1';
19051898
try {
19061899
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
19071900
if (!error) {

0 commit comments

Comments
 (0)