diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-03 07:44:34 -0500 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-04 01:18:23 -0500 |
commit | 5e5f3f0f801321078c897a5de0b4b4304f234da0 (patch) | |
tree | 58e6b37134328183eb3c0a49852c52c0368da21c /net | |
parent | 8082c37cdc31fb0ed178d9d706bf7568ada0edd9 (diff) |
[IPV6] ADDRCONF: Convert ipv6_get_saddr() to ipv6_dev_get_saddr().
Since most users of ipv6_get_saddr() pass non-NULL as
dst argument, use ipv6_dev_get_saddr() directly.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/addrconf.c | 9 | ||||
-rw-r--r-- | net/ipv6/fib6_rules.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 3 | ||||
-rw-r--r-- | net/ipv6/route.c | 3 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 5 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 3 |
6 files changed, 12 insertions, 15 deletions
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 | 1170 | EXPORT_SYMBOL(ipv6_dev_get_saddr); | |
1171 | int 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 | |||
1177 | EXPORT_SYMBOL(ipv6_get_saddr); | ||
1178 | 1171 | ||
1179 | int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, | 1172 | int 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; |