summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2016-10-12 13:20:11 -0700
committerDavid S. Miller <davem@davemloft.net>2016-10-13 12:05:26 -0400
commit6104e112f4a613506ba1ea9d4b974279f888006b (patch)
treea8b14bd20547bbcf015e0fccff23f17dbf02d7ec /include
parent3c293f4e08b58ad5b78f78d89ca1fd41f87f8729 (diff)
downloadop-kernel-dev-6104e112f4a613506ba1ea9d4b974279f888006b.zip
op-kernel-dev-6104e112f4a613506ba1ea9d4b974279f888006b.tar.gz
net: ipv4: Do not drop to make_route if oif is l3mdev
Commit e0d56fdd7342 was a bit aggressive removing l3mdev calls in the IPv4 stack. If the fib_lookup fails we do not want to drop to make_route if the oif is an l3mdev device. Also reverts 19664c6a0009 ("net: l3mdev: Remove netif_index_is_l3_master") which removed netif_index_is_l3_master. Fixes: e0d56fdd7342 ("net: l3mdev: remove redundant calls") Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/l3mdev.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/net/l3mdev.h b/include/net/l3mdev.h
index b220dab..3832099 100644
--- a/include/net/l3mdev.h
+++ b/include/net/l3mdev.h
@@ -114,6 +114,25 @@ static inline u32 l3mdev_fib_table(const struct net_device *dev)
return tb_id;
}
+static inline bool netif_index_is_l3_master(struct net *net, int ifindex)
+{
+ struct net_device *dev;
+ bool rc = false;
+
+ if (ifindex == 0)
+ return false;
+
+ rcu_read_lock();
+
+ dev = dev_get_by_index_rcu(net, ifindex);
+ if (dev)
+ rc = netif_is_l3_master(dev);
+
+ rcu_read_unlock();
+
+ return rc;
+}
+
struct dst_entry *l3mdev_link_scope_lookup(struct net *net, struct flowi6 *fl6);
static inline
@@ -207,6 +226,11 @@ static inline u32 l3mdev_fib_table_by_index(struct net *net, int ifindex)
return 0;
}
+static inline bool netif_index_is_l3_master(struct net *net, int ifindex)
+{
+ return false;
+}
+
static inline
struct dst_entry *l3mdev_link_scope_lookup(struct net *net, struct flowi6 *fl6)
{
OpenPOWER on IntegriCloud