Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

require('os').networkInterfaces() should return 'netmask' (IPv4) or 'prefixlen' (IPv6) #5731

Closed
mrose17 opened this issue Jun 21, 2013 · 5 comments

Comments

@mrose17
Copy link

mrose17 commented Jun 21, 2013

[ this is so exciting... my first node.js 'issue' ... ]

folks - if you're going to look at an IP address and figure out whether it's on the same subnet, you really need to know network prefix for the address.

looking at http://nodejs.org/api/os.html#os_os_networkinterfaces where we have

{ 
  ...
  en1: 
   [ { address: 'fe80::cabc:c8ff:feef:f996', family: 'IPv6',
       internal: false },
     { address: '10.0.1.123', family: 'IPv4', internal: false } ],
  ...
}

we ought to have:

{ 
  ...
  en1: 
   [ { address: 'fe80::cabc:c8ff:feef:f996', prefixlen: 64, family: 'IPv6',
       internal: false },
     { address: '10.0.1.123', netmask: '0xffffff00', family: 'IPv4', internal: false } ],
  ...
}

/mtr

@tjfontaine
Copy link

already landed in master, see #4743

@mrose17
Copy link
Author

mrose17 commented Jun 21, 2013

thanks... i don't see it on 0.10.12/darwin, but i'm sure i'll see it soon!

@tjfontaine
Copy link

it won't be in the 0.10 releases, because it's new it will be in the 0.11 series, if it's not in the latest it will be in the next

@mrose17
Copy link
Author

mrose17 commented Jun 21, 2013

excellent, thanks... it will take me a little while to figure out the release strategy...

@isaacs
Copy link

isaacs commented Jun 22, 2013

@mrose17 Even-numbered releases are "stable". No new API additions, only fixing bugs, etc.

Odd-numbered releases are "unstable". That's where we work on getting things ready for the next stable branch.

v0.10 releases go off of the v0.10 branch. v0.11 (or whatever the current unstable is) come off of the master branch.

After 0.11 will be 0.12. The next stable release after the 0.12 series will be 1.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants