Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89806
b: refs/heads/master
c: 99cd07a
h: refs/heads/master
v: v3
  • Loading branch information
Juha-Matti Tapio authored and David S. Miller committed Feb 29, 2008
1 parent d06c15d commit 4409f17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fe47b8a65f8b4104e41dc46092dfcf942ce0758
refs/heads/master: 99cd07a537bf4c7c954f31611e30064407104410
10 changes: 10 additions & 0 deletions trunk/include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,16 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
a->s6_addr32[2] == htonl(0x0000ffff));
}

/*
* Check for a RFC 4843 ORCHID address
* (Overlay Routable Cryptographic Hash Identifiers)
*/
static inline int ipv6_addr_orchid(const struct in6_addr *a)
{
return ((a->s6_addr32[0] & htonl(0xfffffff0))
== htonl(0x20010010));
}

/*
* find the first different bit between two addresses
* length of address must be a multiple of 32bits
Expand Down
5 changes: 5 additions & 0 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,11 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
if (hiscore.rule < 7)
hiscore.rule++;
#endif

/* Skip rule 8 for orchid -> non-orchid address pairs. */
if (ipv6_addr_orchid(&ifa->addr) && !ipv6_addr_orchid(daddr))
continue;

/* Rule 8: Use longest matching prefix */
if (hiscore.rule < 8) {
hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr);
Expand Down

0 comments on commit 4409f17

Please sign in to comment.