netforkInterfaces() node 18 compatibility
This commit is contained in:
+6
-6
@@ -743,10 +743,10 @@ function networkInterfaces(callback, rescan, defaultString) {
|
||||
|
||||
if ({}.hasOwnProperty.call(ifaces, nic.iface)) {
|
||||
ifaces[nic.iface].forEach(function (details) {
|
||||
if (details.family === 'IPv4') {
|
||||
if (details.family === 'IPv4' || details.family === 4) {
|
||||
nic.ip4subnet = details.netmask;
|
||||
}
|
||||
if (details.family === 'IPv6') {
|
||||
if (details.family === 'IPv6' || details.family === 6) {
|
||||
nic.ip6subnet = details.netmask;
|
||||
}
|
||||
});
|
||||
@@ -818,11 +818,11 @@ function networkInterfaces(callback, rescan, defaultString) {
|
||||
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
||||
let ifaceName = dev;
|
||||
ifaces[dev].forEach(function (details) {
|
||||
if (details.family === 'IPv4') {
|
||||
if (details.family === 'IPv4' || details.family === 4) {
|
||||
ip4 = details.address;
|
||||
ip4subnet = details.netmask;
|
||||
}
|
||||
if (details.family === 'IPv6') {
|
||||
if (details.family === 'IPv6' || details.family === 6) {
|
||||
if (!ip6 || ip6.match(/^fe80::/i)) {
|
||||
ip6 = details.address;
|
||||
ip6subnet = details.netmask;
|
||||
@@ -984,11 +984,11 @@ function networkInterfaces(callback, rescan, defaultString) {
|
||||
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
||||
let ifaceName = dev;
|
||||
ifaces[dev].forEach(function (details) {
|
||||
if (details.family === 'IPv4') {
|
||||
if (details.family === 'IPv4' || details.family === 4) {
|
||||
ip4 = details.address;
|
||||
ip4subnet = details.netmask;
|
||||
}
|
||||
if (details.family === 'IPv6') {
|
||||
if (details.family === 'IPv6' || details.family === 6) {
|
||||
if (!ip6 || ip6.match(/^fe80::/i)) {
|
||||
ip6 = details.address;
|
||||
ip6subnet = details.netmask;
|
||||
|
||||
Reference in New Issue
Block a user