aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2012-09-10 14:41:07 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-13 16:34:03 -0400
commit91b4b04ff85de9086c959138d747d2808cc83a46 (patch)
tree85c36f26fcc60df164f894923188ee10f51d0456 /net/ipv6/addrconf.c
parent417962a02ba283c8532d61474dc08e0a966cd269 (diff)
ipv6: Compare addresses only bits up to the prefix length (RFC6724).
Compare bits up to the source address's prefix length only to allows DNS load balancing to continue to be used as a tie breaker. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1237d5d037d8..5fd8ec895c8b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1070,8 +1070,10 @@ static int ipv6_get_saddr_eval(struct net *net,
1070 break; 1070 break;
1071 case IPV6_SADDR_RULE_PREFIX: 1071 case IPV6_SADDR_RULE_PREFIX:
1072 /* Rule 8: Use longest matching prefix */ 1072 /* Rule 8: Use longest matching prefix */
1073 score->matchlen = ret = ipv6_addr_diff(&score->ifa->addr, 1073 ret = ipv6_addr_diff(&score->ifa->addr, dst->addr);
1074 dst->addr); 1074 if (ret > score->ifa->prefix_len)
1075 ret = score->ifa->prefix_len;
1076 score->matchlen = ret;
1075 break; 1077 break;
1076 default: 1078 default:
1077 ret = 0; 1079 ret = 0;