networkInterfaces() fix uppercase iface names (linux)

This commit is contained in:
Sebastian Hildebrandt 2026-01-16 16:21:12 +01:00
parent 06e47beec4
commit 505d3277c1
4 changed files with 20 additions and 20 deletions

View File

@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.30.5 | 2026-01-16 | `networkInterfaces()` fix uppercase iface names (linux) |
| 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) |
| 5.30.3 | 2026-01-11 | Updated docs, code cleanup |
| 5.30.2 | 2026-01-08 | `processes()` revert added user (windows) |

View File

@ -57,6 +57,12 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.30.5
</th>
<td>2026-01-16</td>
<td><span class="code">networkInterfaces()</span> fix uppercase support (linux)</td>
</tr>
<tr>
<th scope="row">5.30.4
</th>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.30.4</span></div>
<div class="version">New Version: <span id="version">5.30.5</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">
@ -212,7 +212,7 @@
<div class="title">Downloads last month</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">940</div>
<div class="numbers">941</div>
<div class="title">Dependents</div>
</div>
</div>

View File

@ -281,7 +281,7 @@ function getWindowsNics() {
function getWindowsDNSsuffixes() {
let iface = {};
let dnsSuffixes = {
const dnsSuffixes = {
primaryDNS: '',
exitCode: 0,
ifaces: []
@ -374,7 +374,7 @@ function getWindowsWirelessIfaceSSID(interfaceName) {
}
}
function getWindowsIEEE8021x(connectionType, iface, ifaces) {
let i8021x = {
const i8021x = {
state: 'Unknown',
protocol: 'Unknown'
};
@ -947,7 +947,7 @@ function networkInterfaces(callback, rescan, defaultString) {
ip6 = ip6link;
ip6subnet = ip6linksubnet;
}
const iface = dev.split(':')[0].trim().toLowerCase();
const iface = dev.split(':')[0].trim();
let ifaceSanitized = '';
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
const l = util.mathMin(s.length, 2000);
@ -1290,7 +1290,7 @@ function networkStats(ifaces, callback) {
Object.setPrototypeOf(ifaces, util.stringObj);
}
ifaces = ifaces.trim().toLowerCase().replace(/,+/g, '|');
ifaces = ifaces.trim().replace(/,+/g, '|');
ifacesArray = ifaces.split('|');
}
@ -1334,11 +1334,11 @@ function networkStats(ifaces, callback) {
function networkStatsSingle(iface) {
function parseLinesWindowsPerfData(sections) {
let perfData = [];
const perfData = [];
for (let i in sections) {
if ({}.hasOwnProperty.call(sections, i)) {
if (sections[i].trim() !== '') {
let lines = sections[i].trim().split('\r\n');
const lines = sections[i].trim().split('\r\n');
perfData.push({
name: util
.getValue(lines, 'Name', ':')
@ -1595,7 +1595,7 @@ function getProcessName(processes, pid) {
function networkConnections(callback) {
return new Promise((resolve) => {
process.nextTick(() => {
let result = [];
const result = [];
if (_linux || _freebsd || _openbsd || _netbsd) {
let cmd =
'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) {
}
}
}
// if (line.length >= 7 && line[6].indexOf('users:') > -1) {
// const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
// if (proc.length > 2) {
// process = proc[0].split(' ')[0].split(':')[0];
// pid = parseInt(proc[1], 10);
// }
// }
if (connstate) {
result.push({
protocol: line[0],
@ -1806,7 +1799,7 @@ function networkConnections(callback) {
if (line.length >= 4) {
let localip = line[1];
let localport = '';
let localaddress = line[1].split(':');
const localaddress = line[1].split(':');
if (localaddress.length > 1) {
localport = localaddress[localaddress.length - 1];
localaddress.pop();
@ -1815,14 +1808,14 @@ function networkConnections(callback) {
localip = localip.replace(/\[/g, '').replace(/\]/g, '');
let peerip = line[2];
let peerport = '';
let peeraddress = line[2].split(':');
const peeraddress = line[2].split(':');
if (peeraddress.length > 1) {
peerport = peeraddress[peeraddress.length - 1];
peeraddress.pop();
peerip = peeraddress.join(':');
}
peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
let pid = util.toInt(line[4]);
const pid = util.toInt(line[4]);
let connstate = line[3];
if (connstate === 'HERGESTELLT') {
connstate = 'ESTABLISHED';
@ -1901,7 +1894,7 @@ function networkGatewayDefault(callback) {
process.nextTick(() => {
let result = '';
if (_linux || _freebsd || _openbsd || _netbsd) {
let cmd = 'ip route get 1';
const cmd = 'ip route get 1';
try {
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
if (!error) {