You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undocumented change to "family" attribute in os.networkInterfaces() in Node 18 #42787
Darwin Bens-MacBook-Pro-2.local 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
Subsystem
No response
What steps will reproduce the bug?
Easy to reproduce in the REPL - just call os.networkInterfaces() Each listed IP has a "family" attribute. Before Node 18 this was a string value of "IPv4" or "IPv6", in Node 18 it's a numeric 4 or 6.
How often does it reproduce? Is there a required condition?
Happens 100% of the time. Only requirement is to be running Node 18.
What is the expected behavior?
The family attribute should be either "IPv4" or "IPv6". The Node 18 documentation still describes it this way, and the Node 18 changelog doesn't mention this change, so my assumption is that this is unintended. If it actually was intended, then the documentation and changelog should be updated to reflect it.
The changelog does say "net: make server.address() return an integer for family". If this was unintentional, maybe it could be a side effect from whatever was done in that PR? (I haven't looked at that PR, nor am I familiar with Node's internals, so this is just a guess.)
changed the title [-]Undocumented change to "family" attribute in os.networkInterfaces() in Node18[/-][+]Undocumented change to "family" attribute in os.networkInterfaces() in Node 18[/+]on Apr 19, 2022
Activity
[-]Undocumented change to "family" attribute in os.networkInterfaces() in Node18[/-][+]Undocumented change to "family" attribute in os.networkInterfaces() in Node 18[/+]BethGriggs commentedon Apr 19, 2022
/cc @aduh95 as the author of #41431
bl-ue commentedon Apr 19, 2022
Related: #41431 (comment)
doc: fix outdated documentation for `family` property
richardlau commentedon Apr 20, 2022
#41431 has now introduced an inconsistency between
os.networkInterfaces()and diagnostic reports. e.g.compared to:
fix: nodejs/node#42787
fix: nodejs/node#42787
doc: fix outdated documentation for `family` property
doc: fix outdated documentation for `family` property
doc: fix outdated documentation for `family` property
Use lts version of node instead of latest
Merge pull request #40 from Alexander-Taran/master
Squashed 'vendor/whistle/' changes from 05e991e17..74ef62c97
Squashed 'vendor/whistle/' changes from 05e991e173..71c05db286
Detect network address on Node 18
node-transport: delete intfHasAddressFamily