aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/addrconf.h3
-rw-r--r--net/ipv6/addrconf.c9
-rw-r--r--net/ipv6/fib6_rules.c4
-rw-r--r--net/ipv6/ip6_output.c3
-rw-r--r--net/ipv6/route.c3
-rw-r--r--net/ipv6/xfrm6_policy.c5
-rw-r--r--net/sctp/ipv6.c3
7 files changed, 12 insertions, 18 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index a9ff97c120c7..89e3c53c8886 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -73,9 +73,6 @@ extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
73 struct net_device *dev, 73 struct net_device *dev,
74 int strict); 74 int strict);
75 75
76extern int ipv6_get_saddr(struct dst_entry *dst,
77 struct in6_addr *daddr,
78 struct in6_addr *saddr);
79extern int ipv6_dev_get_saddr(struct net_device *dev, 76extern int ipv6_dev_get_saddr(struct net_device *dev,
80 struct in6_addr *daddr, 77 struct in6_addr *daddr,
81 struct in6_addr *saddr); 78 struct in6_addr *saddr);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 18e3a9825d81..9b3a2d0e4269 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1167,14 +1167,7 @@ record_it:
1167 return 0; 1167 return 0;
1168} 1168}
1169 1169
1170 1170EXPORT_SYMBOL(ipv6_dev_get_saddr);
1171int ipv6_get_saddr(struct dst_entry *dst,
1172 struct in6_addr *daddr, struct in6_addr *saddr)
1173{
1174 return ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, daddr, saddr);
1175}
1176
1177EXPORT_SYMBOL(ipv6_get_saddr);
1178 1171
1179int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, 1172int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
1180 unsigned char banned_flags) 1173 unsigned char banned_flags)
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 695c0ca8a417..157db3a1ce00 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -85,8 +85,8 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
85 if ((rule->flags & FIB_RULE_FIND_SADDR) && 85 if ((rule->flags & FIB_RULE_FIND_SADDR) &&
86 r->src.plen && !(flags & RT6_LOOKUP_F_HAS_SADDR)) { 86 r->src.plen && !(flags & RT6_LOOKUP_F_HAS_SADDR)) {
87 struct in6_addr saddr; 87 struct in6_addr saddr;
88 if (ipv6_get_saddr(&rt->u.dst, &flp->fl6_dst, 88 if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
89 &saddr)) 89 &flp->fl6_dst, &saddr))
90 goto again; 90 goto again;
91 if (!ipv6_prefix_equal(&saddr, &r->src.addr, 91 if (!ipv6_prefix_equal(&saddr, &r->src.addr,
92 r->src.plen)) 92 r->src.plen))
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index a59d259cf97e..ff3971173e1e 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -919,7 +919,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
919 goto out_err_release; 919 goto out_err_release;
920 920
921 if (ipv6_addr_any(&fl->fl6_src)) { 921 if (ipv6_addr_any(&fl->fl6_src)) {
922 err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); 922 err = ipv6_dev_get_saddr(ip6_dst_idev(*dst)->dev,
923 &fl->fl6_dst, &fl->fl6_src);
923 if (err) 924 if (err)
924 goto out_err_release; 925 goto out_err_release;
925 } 926 }
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1b15e1708409..6abe7da45ef7 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2122,7 +2122,8 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
2122 NLA_PUT_U32(skb, RTA_IIF, iif); 2122 NLA_PUT_U32(skb, RTA_IIF, iif);
2123 else if (dst) { 2123 else if (dst) {
2124 struct in6_addr saddr_buf; 2124 struct in6_addr saddr_buf;
2125 if (ipv6_get_saddr(&rt->u.dst, dst, &saddr_buf) == 0) 2125 if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
2126 dst, &saddr_buf) == 0)
2126 NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf); 2127 NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf);
2127 } 2128 }
2128 2129
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 7d20199ee1f3..6ef56303e69e 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -57,8 +57,9 @@ static int xfrm6_get_saddr(xfrm_address_t *saddr, xfrm_address_t *daddr)
57 if (IS_ERR(dst)) 57 if (IS_ERR(dst))
58 return -EHOSTUNREACH; 58 return -EHOSTUNREACH;
59 59
60 ipv6_get_saddr(dst, (struct in6_addr *)&daddr->a6, 60 ipv6_dev_get_saddr(ip6_dst_idev(dst)->dev,
61 (struct in6_addr *)&saddr->a6); 61 (struct in6_addr *)&daddr->a6,
62 (struct in6_addr *)&saddr->a6);
62 dst_release(dst); 63 dst_release(dst);
63 return 0; 64 return 0;
64} 65}
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 87f940587d5f..3e4878800b36 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -313,7 +313,8 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
313 __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr)); 313 __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr));
314 314
315 if (!asoc) { 315 if (!asoc) {
316 ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr); 316 ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL,
317 &daddr->v6.sin6_addr, &saddr->v6.sin6_addr);
317 SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n", 318 SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
318 NIP6(saddr->v6.sin6_addr)); 319 NIP6(saddr->v6.sin6_addr));
319 return; 320 return;