net: ipv6: Remove l3mdev_get_saddr6
authorDavid Ahern <dsa@cumulusnetworks.com>
Sat, 10 Sep 2016 19:09:59 +0000 (12:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Sep 2016 06:12:53 +0000 (23:12 -0700)
No longer needed

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vrf.c
include/net/l3mdev.h
net/ipv6/ip6_output.c
net/l3mdev/l3mdev.c

index 9ad2a169485ffd72890394e30228b63ecc12d280..3a34f547c5781f9ddee67885f7cd79c6d1e637eb 100644 (file)
@@ -1084,46 +1084,6 @@ static struct dst_entry *vrf_link_scope_lookup(const struct net_device *dev,
 
        return dst;
 }
-
-/* called under rcu_read_lock */
-static int vrf_get_saddr6(struct net_device *dev, const struct sock *sk,
-                         struct flowi6 *fl6)
-{
-       struct net *net = dev_net(dev);
-       struct dst_entry *dst;
-       struct rt6_info *rt;
-       int err;
-
-       if (rt6_need_strict(&fl6->daddr)) {
-               rt = vrf_ip6_route_lookup(net, dev, fl6, fl6->flowi6_oif,
-                                         RT6_LOOKUP_F_IFACE);
-               if (unlikely(!rt))
-                       return 0;
-
-               dst = &rt->dst;
-       } else {
-               __u8 flags = fl6->flowi6_flags;
-
-               fl6->flowi6_flags |= FLOWI_FLAG_L3MDEV_SRC;
-               fl6->flowi6_flags |= FLOWI_FLAG_SKIP_NH_OIF;
-
-               dst = ip6_route_output(net, sk, fl6);
-               rt = (struct rt6_info *)dst;
-
-               fl6->flowi6_flags = flags;
-       }
-
-       err = dst->error;
-       if (!err) {
-               err = ip6_route_get_saddr(net, rt, &fl6->daddr,
-                                         sk ? inet6_sk(sk)->srcprefs : 0,
-                                         &fl6->saddr);
-       }
-
-       dst_release(dst);
-
-       return err;
-}
 #endif
 
 static const struct l3mdev_ops vrf_l3mdev_ops = {
@@ -1133,7 +1093,6 @@ static const struct l3mdev_ops vrf_l3mdev_ops = {
        .l3mdev_l3_out          = vrf_l3_out,
 #if IS_ENABLED(CONFIG_IPV6)
        .l3mdev_link_scope_lookup = vrf_link_scope_lookup,
-       .l3mdev_get_saddr6      = vrf_get_saddr6,
 #endif
 };
 
index 1129e1d8cd6ea95055cc094e54a2abdac8b93e97..a5e506eb51de59682010740eefae10f66e44a869 100644 (file)
@@ -43,9 +43,6 @@ struct l3mdev_ops {
        /* IPv6 ops */
        struct dst_entry * (*l3mdev_link_scope_lookup)(const struct net_device *dev,
                                                 struct flowi6 *fl6);
-       int                (*l3mdev_get_saddr6)(struct net_device *dev,
-                                               const struct sock *sk,
-                                               struct flowi6 *fl6);
 };
 
 #ifdef CONFIG_NET_L3_MASTER_DEV
@@ -172,8 +169,6 @@ static inline bool netif_index_is_l3_master(struct net *net, int ifindex)
 }
 
 struct dst_entry *l3mdev_link_scope_lookup(struct net *net, struct flowi6 *fl6);
-int l3mdev_get_saddr6(struct net *net, const struct sock *sk,
-                     struct flowi6 *fl6);
 
 static inline
 struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto)
@@ -292,12 +287,6 @@ struct dst_entry *l3mdev_link_scope_lookup(struct net *net, struct flowi6 *fl6)
        return NULL;
 }
 
-static inline int l3mdev_get_saddr6(struct net *net, const struct sock *sk,
-                                   struct flowi6 *fl6)
-{
-       return 0;
-}
-
 static inline
 struct sk_buff *l3mdev_ip_rcv(struct sk_buff *skb)
 {
index 1cb41b36504889e1d2f9c4a15c2f35ee4f3aad8e..6001e781164eb6d49cf604e7d8067a42ebc7dc3d 100644 (file)
@@ -926,13 +926,6 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
        int err;
        int flags = 0;
 
-       if (ipv6_addr_any(&fl6->saddr) && fl6->flowi6_oif &&
-           (!*dst || !(*dst)->error)) {
-               err = l3mdev_get_saddr6(net, sk, fl6);
-               if (err)
-                       goto out_err;
-       }
-
        /* The correct way to handle this would be to do
         * ip6_route_get_saddr, and then ip6_route_output; however,
         * the route-specific preferred source forces the
@@ -1024,7 +1017,7 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
 out_err_release:
        dst_release(*dst);
        *dst = NULL;
-out_err:
+
        if (err == -ENETUNREACH)
                IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
        return err;
index be40df60703cf40d351f3b6f552dc016225a0797..8da86ceca33ddf4c4e5d61850ce54f22a29e6fb9 100644 (file)
@@ -130,30 +130,6 @@ struct dst_entry *l3mdev_link_scope_lookup(struct net *net,
 }
 EXPORT_SYMBOL_GPL(l3mdev_link_scope_lookup);
 
-int l3mdev_get_saddr6(struct net *net, const struct sock *sk,
-                     struct flowi6 *fl6)
-{
-       struct net_device *dev;
-       int rc = 0;
-
-       if (fl6->flowi6_oif) {
-               rcu_read_lock();
-
-               dev = dev_get_by_index_rcu(net, fl6->flowi6_oif);
-               if (dev && netif_is_l3_slave(dev))
-                       dev = netdev_master_upper_dev_get_rcu(dev);
-
-               if (dev && netif_is_l3_master(dev) &&
-                   dev->l3mdev_ops->l3mdev_get_saddr6)
-                       rc = dev->l3mdev_ops->l3mdev_get_saddr6(dev, sk, fl6);
-
-               rcu_read_unlock();
-       }
-
-       return rc;
-}
-EXPORT_SYMBOL_GPL(l3mdev_get_saddr6);
-
 /**
  *     l3mdev_fib_rule_match - Determine if flowi references an
  *                             L3 master device