diff options
author | Pedro Ribeiro <pribeiro@net.ipl.pt> | 2008-10-15 18:47:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-15 19:03:01 -0400 |
commit | 22441cfa0c70dcd457f3c081fcf285c3bd155824 (patch) | |
tree | c313183f0b7a9c3736d5b042f8e97780d7670609 /include/linux/icmpv6.h | |
parent | deb28d9bc4bb6922c1f7e459744d7b2d0db3a1d2 (diff) |
IPV6: Fix default gateway criteria wrt. HIGH/LOW preference radv option
Problem observed:
In IPv6, in the presence of multiple routers candidates to
default gateway in one segment, each sending a different
value of preference, the Linux hosts connected to the
segment weren't selecting the right one in all the
combinations possible of LOW/MEDIUM/HIGH preference.
This patch changes two files:
include/linux/icmpv6.h
Get the "router_pref" bitfield in the right place
(as RFC4191 says), named the bit left with this fix as
"home_agent" (RFC3775 say that's his function)
net/ipv6/ndisc.c
Corrects the binary logic behind the updating of the
router preference in the flags of the routing table
Result:
With this two fixes applied, the default route used by
the system was to consistent with the rules mentioned
in RFC4191 in case of changes in the value of preference
in router advertisements
Signed-off-by: Pedro Ribeiro <pribeiro@net.ipl.pt>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/icmpv6.h')
-rw-r--r-- | include/linux/icmpv6.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 03067443198..a93a8dd3311 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -40,16 +40,18 @@ struct icmp6hdr { | |||
40 | struct icmpv6_nd_ra { | 40 | struct icmpv6_nd_ra { |
41 | __u8 hop_limit; | 41 | __u8 hop_limit; |
42 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 42 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
43 | __u8 reserved:4, | 43 | __u8 reserved:3, |
44 | router_pref:2, | 44 | router_pref:2, |
45 | home_agent:1, | ||
45 | other:1, | 46 | other:1, |
46 | managed:1; | 47 | managed:1; |
47 | 48 | ||
48 | #elif defined(__BIG_ENDIAN_BITFIELD) | 49 | #elif defined(__BIG_ENDIAN_BITFIELD) |
49 | __u8 managed:1, | 50 | __u8 managed:1, |
50 | other:1, | 51 | other:1, |
52 | home_agent:1, | ||
51 | router_pref:2, | 53 | router_pref:2, |
52 | reserved:4; | 54 | reserved:3; |
53 | #else | 55 | #else |
54 | #error "Please fix <asm/byteorder.h>" | 56 | #error "Please fix <asm/byteorder.h>" |
55 | #endif | 57 | #endif |