Skip to content

Commit

Permalink
Merge pull request #40 from Alexander-Taran/master
Browse files Browse the repository at this point in the history
Accept number coming from os.networkInterfaces() family, see nodejs/node#42787
  • Loading branch information
scravy authored Jun 23, 2022
2 parents 9bbc24f + 4fcdb78 commit 1722be3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/networkinterfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module.exports = function () {
var hasAddresses = false;
ifaces[iface].forEach(function (address) {
if (!address.internal) {
addresses[(address.family || "").toLowerCase()] = address.address;
var family = typeof address.family === 'number' ? "ipv" + address.family : address.family.toLowerCase() || "";
addresses[family] = address.address;
hasAddresses = true;
if (address.mac && address.mac !== '00:00:00:00:00:00') {
addresses.mac = address.mac;
Expand Down

0 comments on commit 1722be3

Please sign in to comment.