vlan: advertise link netns via netlink
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Tue, 20 Jan 2015 14:15:44 +0000 (15:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Jan 2015 01:51:15 +0000 (17:51 -0800)
Assign rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is
added to rtnetlink messages.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan_netlink.c

index 8ac8a5c..c92b52f 100644 (file)
@@ -238,6 +238,13 @@ nla_put_failure:
        return -EMSGSIZE;
 }
 
+static struct net *vlan_get_link_net(const struct net_device *dev)
+{
+       struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
+
+       return dev_net(real_dev);
+}
+
 struct rtnl_link_ops vlan_link_ops __read_mostly = {
        .kind           = "vlan",
        .maxtype        = IFLA_VLAN_MAX,
@@ -250,6 +257,7 @@ struct rtnl_link_ops vlan_link_ops __read_mostly = {
        .dellink        = unregister_vlan_dev,
        .get_size       = vlan_get_size,
        .fill_info      = vlan_fill_info,
+       .get_link_net   = vlan_get_link_net,
 };
 
 int __init vlan_netlink_init(void)