]> err.no Git - linux-2.6/commitdiff
[IPV6] ADDRCONF: Convert ipv6_get_saddr() to ipv6_dev_get_saddr().
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Mon, 3 Mar 2008 12:44:34 +0000 (21:44 +0900)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Tue, 4 Mar 2008 06:18:23 +0000 (15:18 +0900)
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>
include/net/addrconf.h
net/ipv6/addrconf.c
net/ipv6/fib6_rules.c
net/ipv6/ip6_output.c
net/ipv6/route.c
net/ipv6/xfrm6_policy.c
net/sctp/ipv6.c

index a9ff97c120c7d428e01f11f62c5f1bace6a7038f..89e3c53c888695d6b0bd6bf08382bba323c744fe 100644 (file)
@@ -73,9 +73,6 @@ extern struct inet6_ifaddr      *ipv6_get_ifaddr(struct net *net,
                                                 struct net_device *dev,
                                                 int strict);
 
-extern int                     ipv6_get_saddr(struct dst_entry *dst, 
-                                              struct in6_addr *daddr,
-                                              struct in6_addr *saddr);
 extern int                     ipv6_dev_get_saddr(struct net_device *dev, 
                                               struct in6_addr *daddr,
                                               struct in6_addr *saddr);
index 18e3a9825d8124347d26957e100e5d527a13075e..9b3a2d0e426998dc06a171b25b4cfa7d5abfe125 100644 (file)
@@ -1167,14 +1167,7 @@ record_it:
        return 0;
 }
 
-
-int ipv6_get_saddr(struct dst_entry *dst,
-                  struct in6_addr *daddr, struct in6_addr *saddr)
-{
-       return ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, daddr, saddr);
-}
-
-EXPORT_SYMBOL(ipv6_get_saddr);
+EXPORT_SYMBOL(ipv6_dev_get_saddr);
 
 int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
                    unsigned char banned_flags)
index 695c0ca8a41708296384f9312fbfc79946cc1537..157db3a1ce00deaac156f3b827260f664940583b 100644 (file)
@@ -85,8 +85,8 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
                if ((rule->flags & FIB_RULE_FIND_SADDR) &&
                    r->src.plen && !(flags & RT6_LOOKUP_F_HAS_SADDR)) {
                        struct in6_addr saddr;
-                       if (ipv6_get_saddr(&rt->u.dst, &flp->fl6_dst,
-                                          &saddr))
+                       if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
+                                              &flp->fl6_dst, &saddr))
                                goto again;
                        if (!ipv6_prefix_equal(&saddr, &r->src.addr,
                                               r->src.plen))
index a59d259cf97ead6919a8e745b63b649a32e1b91c..ff3971173e1e208b995f6d3c75b91361eac61ab6 100644 (file)
@@ -919,7 +919,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
                goto out_err_release;
 
        if (ipv6_addr_any(&fl->fl6_src)) {
-               err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);
+               err = ipv6_dev_get_saddr(ip6_dst_idev(*dst)->dev,
+                                        &fl->fl6_dst, &fl->fl6_src);
                if (err)
                        goto out_err_release;
        }
index 1b15e17084097e359ed2812d7d1c1161200ba36d..6abe7da45ef77ac16aded948547d5f4f718725fd 100644 (file)
@@ -2122,7 +2122,8 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
                NLA_PUT_U32(skb, RTA_IIF, iif);
        else if (dst) {
                struct in6_addr saddr_buf;
-               if (ipv6_get_saddr(&rt->u.dst, dst, &saddr_buf) == 0)
+               if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
+                                      dst, &saddr_buf) == 0)
                        NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf);
        }
 
index 7d20199ee1f39cb98c4622042fe9460e4dbd42a7..6ef56303e69ef735f0ee0785368901a6a56a3fe2 100644 (file)
@@ -57,8 +57,9 @@ static int xfrm6_get_saddr(xfrm_address_t *saddr, xfrm_address_t *daddr)
        if (IS_ERR(dst))
                return -EHOSTUNREACH;
 
-       ipv6_get_saddr(dst, (struct in6_addr *)&daddr->a6,
-                      (struct in6_addr *)&saddr->a6);
+       ipv6_dev_get_saddr(ip6_dst_idev(dst)->dev,
+                          (struct in6_addr *)&daddr->a6,
+                          (struct in6_addr *)&saddr->a6);
        dst_release(dst);
        return 0;
 }
index 87f940587d5fe8d3cd72ff33cf0a995498e4c093..3e4878800b361f6d0567e1cff458895a3d691542 100644 (file)
@@ -313,7 +313,8 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
                          __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr));
 
        if (!asoc) {
-               ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr);
+               ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL,
+                                  &daddr->v6.sin6_addr, &saddr->v6.sin6_addr);
                SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
                                  NIP6(saddr->v6.sin6_addr));
                return;