ipvlan: implement ndo_get_iflink
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 2 Apr 2015 15:07:06 +0000 (17:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Apr 2015 18:05:00 +0000 (14:05 -0400)
Don't use dev->iflink anymore.

CC: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_main.c

index 2950c3780230596270aa64d0ebac69f7c1bd3cbd..1701ede2df89e36d2474946b8e7bd6b5b2915704 100644 (file)
@@ -114,7 +114,6 @@ static int ipvlan_init(struct net_device *dev)
        dev->features = phy_dev->features & IPVLAN_FEATURES;
        dev->features |= NETIF_F_LLTX;
        dev->gso_max_size = phy_dev->gso_max_size;
-       dev->iflink = phy_dev->ifindex;
        dev->hard_header_len = phy_dev->hard_header_len;
 
        ipvlan_set_lockdep_class(dev);
@@ -305,6 +304,13 @@ static int ipvlan_vlan_rx_kill_vid(struct net_device *dev, __be16 proto,
        return 0;
 }
 
+static int ipvlan_get_iflink(const struct net_device *dev)
+{
+       struct ipvl_dev *ipvlan = netdev_priv(dev);
+
+       return ipvlan->phy_dev->ifindex;
+}
+
 static const struct net_device_ops ipvlan_netdev_ops = {
        .ndo_init               = ipvlan_init,
        .ndo_uninit             = ipvlan_uninit,
@@ -317,6 +323,7 @@ static const struct net_device_ops ipvlan_netdev_ops = {
        .ndo_get_stats64        = ipvlan_get_stats64,
        .ndo_vlan_rx_add_vid    = ipvlan_vlan_rx_add_vid,
        .ndo_vlan_rx_kill_vid   = ipvlan_vlan_rx_kill_vid,
+       .ndo_get_iflink         = ipvlan_get_iflink,
 };
 
 static int ipvlan_hard_header(struct sk_buff *skb, struct net_device *dev,