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

Ipv6 #113

Merged
merged 19 commits into from
Oct 10, 2016
Merged

Ipv6 #113

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed link local addresses.
  • Loading branch information
rakshasa committed Oct 28, 2014
commit b80b5580cd77aaf5399a12588402c25b806b5f27
8 changes: 4 additions & 4 deletions src/net/local_addr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace {
// IPv4 priority, from highest to lowest:
//
// 1. Everything else (global address)
// 2. Private address space (10.0.0.0/8, 172.16.0.0/16, 192.168.0.0/24)
// 2. Private address space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
// 3. Empty/INADDR_ANY (0.0.0.0)
// 4. Link-local address (169.254.0.0/16)
// 5. Localhost (127.0.0.0/8)
Expand All @@ -69,14 +69,14 @@ get_priority_ipv4(const in_addr& addr) {
if ((addr.s_addr & htonl(0xff000000U)) == htonl(0x7f000000U)) {
return 5;
}
if (addr.s_addr == htonl(0)) {
if ((addr.s_addr & htonl(0xffff0000U)) == htonl(0xa9fe0000U)) {
return 4;
}
if ((addr.s_addr & htonl(0xffff0000U)) == htonl(0xa9fe0000U)) {
if (addr.s_addr == htonl(0)) {
return 3;
}
if ((addr.s_addr & htonl(0xff000000U)) == htonl(0x0a000000U) ||
(addr.s_addr & htonl(0xffff0000U)) == htonl(0xac100000U) ||
(addr.s_addr & htonl(0xfff00000U)) == htonl(0xac100000U) ||
(addr.s_addr & htonl(0xffff0000U)) == htonl(0xc0a80000U)) {
return 2;
}
Expand Down