Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify CIDR retrieval #33

Merged
merged 1 commit into from Aug 4, 2020
Merged

Simplify CIDR retrieval #33

merged 1 commit into from Aug 4, 2020

Conversation

silverwind
Copy link
Collaborator

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
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
Collaborator 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.

None yet

2 participants