Skip to content

Simplify CIDR retrieval#33

Merged
sindresorhus merged 1 commit intomasterfrom
cidr
Aug 4, 2020
Merged

Simplify CIDR retrieval#33
sindresorhus merged 1 commit intomasterfrom
cidr

Conversation

@silverwind
Copy link
Copy Markdown
Contributor

os.networkInterfaces() does support a new cidr property since version 8.5.0 which is below the minimum 10.0.0 required by this module so use it.

Ref: nodejs/node#14307

os.networkInterfaces() does support a new .cidr property since version
8.5.0 which is below the minimum 10.0.0 required by this module so use it.

Ref: nodejs/node#14307
@sindresorhus
Copy link
Copy Markdown
Owner

Nice! Have you considered opening Node.js feature requests for some of the other things in here? Like getting the default gateway, parsing CIDR, etc.

@sindresorhus sindresorhus changed the title Simplify cidr retrieval Simplify CIDR retrieval Aug 4, 2020
@sindresorhus sindresorhus merged commit 5fd6716 into master Aug 4, 2020
@sindresorhus sindresorhus deleted the cidr branch August 4, 2020 17:37
@silverwind
Copy link
Copy Markdown
Contributor Author

silverwind commented Aug 4, 2020

getting the default gateway

Was rejected years ago as being too complex because of OS differences.

parsing CIDR

I guess that may be worth exploring. I'd love to get rid of the ipaddr.js dependency here. Essentially we need something lightweight to match a ip to a subnet. Should not be too hard with BigInt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants