Skip to content

std: Fix endianness in Ord for IP addresses #29724

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

Merged
merged 1 commit into from
Nov 10, 2015

Conversation

alexcrichton
Copy link
Member

The comparison of IP addresses should happen not always in network endianness
but rather in the host endianness format, so be sure to convert to that before
comparing addresses.

There are still locations where the endianness will factor into visible
properties, such as the hash, but these are not important to be independent of
the endianness in play (as hash values are pretty undefined anyway.

Closes #29691

The comparison of IP addresses should happen not always in network endianness
but rather in the host endianness format, so be sure to convert to that before
comparing addresses.

There are still locations where the endianness will factor into visible
properties, such as the hash, but these are not important to be independent of
the endianness in play (as hash values are pretty undefined anyway.

Closes rust-lang#29691
@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @aturon (or others from @rust-lang/libs)

@rust-highfive rust-highfive assigned aturon and unassigned nikomatsakis Nov 9, 2015
@aturon
Copy link
Member

aturon commented Nov 9, 2015

@bors: r+

@bors
Copy link
Collaborator

bors commented Nov 9, 2015

📌 Commit f16e7b4 has been approved by aturon

bors added a commit that referenced this pull request Nov 10, 2015
The comparison of IP addresses should happen not always in network endianness
but rather in the host endianness format, so be sure to convert to that before
comparing addresses.

There are still locations where the endianness will factor into visible
properties, such as the hash, but these are not important to be independent of
the endianness in play (as hash values are pretty undefined anyway.

Closes #29691
@bors
Copy link
Collaborator

bors commented Nov 10, 2015

⌛ Testing commit f16e7b4 with merge 3519eff...

@bors bors merged commit f16e7b4 into rust-lang:master Nov 10, 2015
@alexcrichton alexcrichton deleted the ip-endian branch January 21, 2016 01:31
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.

5 participants