net: Rename FLOWI_FLAG_VRFSRC to FLOWI_FLAG_L3MDEV_SRC
[deliverable/linux.git] / drivers / net / vrf.c
index df872f4efb0d5d5453daddcaf8f6242bc6b8dabf..4fd5af1acff05d800a2192da928d979d6bf8cd6e 100644 (file)
@@ -34,7 +34,6 @@
 #include <net/rtnetlink.h>
 #include <net/route.h>
 #include <net/addrconf.h>
-#include <net/vrf.h>
 #include <net/l3mdev.h>
 
 #define DRV_NAME       "vrf"
 #define vrf_master_get_rcu(dev) \
        ((struct net_device *)rcu_dereference(dev->rx_handler_data))
 
+struct slave {
+       struct list_head        list;
+       struct net_device       *dev;
+};
+
+struct slave_queue {
+       struct list_head        all_slaves;
+};
+
+struct net_vrf {
+       struct slave_queue      queue;
+       struct rtable           *rth;
+       u32                     tb_id;
+};
+
 struct pcpu_dstats {
        u64                     tx_pkts;
        u64                     tx_bytes;
@@ -194,7 +208,7 @@ static netdev_tx_t vrf_process_v4_outbound(struct sk_buff *skb,
                .flowi4_oif = vrf_dev->ifindex,
                .flowi4_iif = LOOPBACK_IFINDEX,
                .flowi4_tos = RT_TOS(ip4h->tos),
-               .flowi4_flags = FLOWI_FLAG_ANYSRC | FLOWI_FLAG_VRFSRC |
+               .flowi4_flags = FLOWI_FLAG_ANYSRC | FLOWI_FLAG_L3MDEV_SRC |
                                FLOWI_FLAG_SKIP_NH_OIF,
                .daddr = ip4h->daddr,
        };
@@ -531,7 +545,7 @@ static struct rtable *vrf_get_rtable(const struct net_device *dev,
 {
        struct rtable *rth = NULL;
 
-       if (!(fl4->flowi4_flags & FLOWI_FLAG_VRFSRC)) {
+       if (!(fl4->flowi4_flags & FLOWI_FLAG_L3MDEV_SRC)) {
                struct net_vrf *vrf = netdev_priv(dev);
 
                rth = vrf->rth;
@@ -658,7 +672,7 @@ static int vrf_device_event(struct notifier_block *unused,
        if (event == NETDEV_UNREGISTER) {
                struct net_device *vrf_dev;
 
-               if (netif_is_l3_master(dev))
+               if (!vrf_is_slave(dev) || netif_is_l3_master(dev))
                        goto out;
 
                vrf_dev = netdev_master_upper_dev_get(dev);
This page took 0.025525 seconds and 5 git commands to generate.