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

Reimplement match lang ip #1972

Merged
merged 2 commits into from
Apr 19, 2016
Merged

Reimplement match lang ip #1972

merged 2 commits into from
Apr 19, 2016

Conversation

muellmusik
Copy link
Contributor

This PR reimplements the prMatchLangIP primitive.

  • The existing boost::asio implementation caused problems on some platforms
  • It is preferable to avoid host resolution in implemeting this
  • This default version should work on Linux, OSX, and most nix-y systems
  • A windows specific implementation was added using GetAdaptersAddresses

Thanks to @bagong for help testing and debugging the Windows version!

- The existing boost::asio implementation caused problems on some platforms
- It is preferable to avoid host resolution in implemeting this
- This default version should work on Linux, OSX, and most nix-y systems

Signed-off-by: Scott Wilson <i@scottwilson.ca>
- getifaddrs not available on windows

Signed-off-by: Scott Wilson <i@scottwilson.ca>
@crucialfelix crucialfelix added this to the 3.8 milestone Apr 18, 2016
@muellmusik
Copy link
Contributor Author

Ping... I know this isn't at all old, but as it required painful cross-platform testing, it would be really nice to merge this sooner rather than later to avoid any conflicts.

@crucialfelix
Copy link
Member

Can somebody else have a glance at this ? I'm super overworked today.

@miguel-negrao
Copy link
Member

Not sure how exactly this should be tested, but here in debian testing, with this pull-request I get:

NetAddr.matchLangIP("127.0.0.1")

-> true

NetAddr.matchLangIP("192.168.1.79") //my local ethernet interface ip

-> true

NetAddr.matchLangIP("1.1.1.1")

-> false

@muellmusik
Copy link
Contributor Author

Not sure how exactly this should be tested, but here in debian testing, with this pull-request I get:

That looks correct Miguel, thanks.

@crucialfelix crucialfelix added the comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" label Apr 19, 2016
@crucialfelix crucialfelix merged commit 7436c53 into master Apr 19, 2016
@mossheim mossheim deleted the reimplement-matchLangIP branch January 15, 2017 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants