Skip to content

Fix check for globally routable IPv4 address - #24343

Merged
bors merged 1 commit into
rust-lang:masterfrom
achanda:global_ip
Apr 15, 2015
Merged

bors merged 1 commit into
rust-lang:masterfrom
achanda:global_ip

Conversation

@achanda

@achanda achanda commented Apr 12, 2015

Copy link
Copy Markdown
Contributor
  • Adds two more functions for broadcast address and special
    address classes reserved for documentation
  • Modifies the globally routable IP check to include these
    new functions

Fixes #24314

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@alexcrichton

Copy link
Copy Markdown
Member

Thanks! Could you add some tests for these as well?

@alexcrichton

Copy link
Copy Markdown
Member

That'll work, but it's more conventional to put unit tests at the end of the module itself, so feel free to add something like this to the end of the module:

#[cfg(test)]
mod tests {
    #[test]
    fn foo() { /* ... */ }
}

@achanda

achanda commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton sorry, I deleted my earlier comment by mistake. I found existing tests for ip.rs in src/libstd/net/addr.rs, which looks like a wrong place for those tests. I think I will do this, add tests for the new methods in addr.rs and the move related tests to ip.rs in a separate commit. That way we do not clutter this commit. Let me know if this sounds good to you.

@alexcrichton

Copy link
Copy Markdown
Member

Sounds great to me, thanks for the drive-by cleanup!

- Adds two more functions for broadcast address and special
  address classes reserved for documentation
- Modifies the globally routable IP check to include these
  new functions

Fixes #24314
@achanda

achanda commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton this passes tests on my local machine. Please check.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ f60f4b7

Thanks!

@achanda

achanda commented Apr 14, 2015

Copy link
Copy Markdown
Contributor Author

@alexcrichton How will this PR be merged? I did not see any job being run for this PR in buildbot. Do I need to do something else? Sorry, still new here :)

@alexcrichton

Copy link
Copy Markdown
Member

Ah right, this is now in the queue and when it reaches the top @bors will comment that it's being tested. After that @bors will comment with the test results afterwards.

@achanda

achanda commented Apr 14, 2015

Copy link
Copy Markdown
Contributor Author

👍

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 14, 2015
- Adds two more functions for broadcast address and special
  address classes reserved for documentation
- Modifies the globally routable IP check to include these
  new functions

Fixes rust-lang#24314
@bors
bors merged commit f60f4b7 into rust-lang:master Apr 15, 2015
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.

Some special IP addresses are being wrongly detected as globally routable

4 participants