Skip to content

Commit

Permalink
ipv6: Compare addresses only bits up to the prefix length (RFC6724).
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
yoshfuji authored and davem330 committed Sep 13, 2012
1 parent 417962a commit 91b4b04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,10 @@ static int ipv6_get_saddr_eval(struct net *net,
break;
case IPV6_SADDR_RULE_PREFIX:
/* Rule 8: Use longest matching prefix */
score->matchlen = ret = ipv6_addr_diff(&score->ifa->addr,
dst->addr);
ret = ipv6_addr_diff(&score->ifa->addr, dst->addr);
if (ret > score->ifa->prefix_len)
ret = score->ifa->prefix_len;
score->matchlen = ret;
break;
default:
ret = 0;
Expand Down

0 comments on commit 91b4b04

Please sign in to comment.