aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9ea4e62741ee..fa43374e85c5 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -964,7 +964,8 @@ static inline int ipv6_saddr_preferred(int type)
964 return 0; 964 return 0;
965} 965}
966 966
967static int ipv6_get_saddr_eval(struct ipv6_saddr_score *score, 967static int ipv6_get_saddr_eval(struct net *net,
968 struct ipv6_saddr_score *score,
968 struct ipv6_saddr_dst *dst, 969 struct ipv6_saddr_dst *dst,
969 int i) 970 int i)
970{ 971{
@@ -1043,7 +1044,8 @@ static int ipv6_get_saddr_eval(struct ipv6_saddr_score *score,
1043 break; 1044 break;
1044 case IPV6_SADDR_RULE_LABEL: 1045 case IPV6_SADDR_RULE_LABEL:
1045 /* Rule 6: Prefer matching label */ 1046 /* Rule 6: Prefer matching label */
1046 ret = ipv6_addr_label(&score->ifa->addr, score->addr_type, 1047 ret = ipv6_addr_label(net,
1048 &score->ifa->addr, score->addr_type,
1047 score->ifa->idev->dev->ifindex) == dst->label; 1049 score->ifa->idev->dev->ifindex) == dst->label;
1048 break; 1050 break;
1049#ifdef CONFIG_IPV6_PRIVACY 1051#ifdef CONFIG_IPV6_PRIVACY
@@ -1097,7 +1099,7 @@ int ipv6_dev_get_saddr(struct net_device *dst_dev,
1097 dst.addr = daddr; 1099 dst.addr = daddr;
1098 dst.ifindex = dst_dev ? dst_dev->ifindex : 0; 1100 dst.ifindex = dst_dev ? dst_dev->ifindex : 0;
1099 dst.scope = __ipv6_addr_src_scope(dst_type); 1101 dst.scope = __ipv6_addr_src_scope(dst_type);
1100 dst.label = ipv6_addr_label(daddr, dst_type, dst.ifindex); 1102 dst.label = ipv6_addr_label(net, daddr, dst_type, dst.ifindex);
1101 dst.prefs = prefs; 1103 dst.prefs = prefs;
1102 1104
1103 hiscore->rule = -1; 1105 hiscore->rule = -1;
@@ -1165,8 +1167,8 @@ int ipv6_dev_get_saddr(struct net_device *dst_dev,
1165 for (i = 0; i < IPV6_SADDR_RULE_MAX; i++) { 1167 for (i = 0; i < IPV6_SADDR_RULE_MAX; i++) {
1166 int minihiscore, miniscore; 1168 int minihiscore, miniscore;
1167 1169
1168 minihiscore = ipv6_get_saddr_eval(hiscore, &dst, i); 1170 minihiscore = ipv6_get_saddr_eval(net, hiscore, &dst, i);
1169 miniscore = ipv6_get_saddr_eval(score, &dst, i); 1171 miniscore = ipv6_get_saddr_eval(net, score, &dst, i);
1170 1172
1171 if (minihiscore > miniscore) { 1173 if (minihiscore > miniscore) {
1172 if (i == IPV6_SADDR_RULE_SCOPE && 1174 if (i == IPV6_SADDR_RULE_SCOPE &&