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>
This commit is contained in:
parent
417962a02b
commit
91b4b04ff8
|
@ -1070,8 +1070,10 @@ static int ipv6_get_saddr_eval(struct net *net,
|
||||||
break;
|
break;
|
||||||
case IPV6_SADDR_RULE_PREFIX:
|
case IPV6_SADDR_RULE_PREFIX:
|
||||||
/* Rule 8: Use longest matching prefix */
|
/* Rule 8: Use longest matching prefix */
|
||||||
score->matchlen = ret = ipv6_addr_diff(&score->ifa->addr,
|
ret = ipv6_addr_diff(&score->ifa->addr, dst->addr);
|
||||||
dst->addr);
|
if (ret > score->ifa->prefix_len)
|
||||||
|
ret = score->ifa->prefix_len;
|
||||||
|
score->matchlen = ret;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
Loading…
Reference in a new issue