瀏覽代碼

[IPV6] ADDRCONF: Fix default source address selection without CONFIG_IPV6_PRIVACY

We need to update hiscore.rule even if we don't enable CONFIG_IPV6_PRIVACY,
because we have more less significant rule; longest match.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
YOSHIFUJI Hideaki 19 年之前
父節點
當前提交
5e2707fa3a
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/ipv6/addrconf.c

+ 3 - 0
net/ipv6/addrconf.c

@@ -1075,6 +1075,9 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
 				if (hiscore.attrs & IPV6_SADDR_SCORE_PRIVACY)
 				if (hiscore.attrs & IPV6_SADDR_SCORE_PRIVACY)
 					continue;
 					continue;
 			}
 			}
+#else
+			if (hiscore.rule < 7)
+				hiscore.rule++;
 #endif
 #endif
 			/* Rule 8: Use longest matching prefix */
 			/* Rule 8: Use longest matching prefix */
 			if (hiscore.rule < 8) {
 			if (hiscore.rule < 8) {