Skip to content

Commit

Permalink
vlan: advertise link netns via netlink
Browse files Browse the repository at this point in the history
Assign rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is
added to rtnetlink messages.

Signed-off-by: Nicolas Dichtel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
NicolasDichtel authored and davem330 committed Jan 24, 2015
1 parent 3390e39 commit 1f17257
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/8021q/vlan_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
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,
Expand All @@ -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)
Expand Down

0 comments on commit 1f17257

Please sign in to comment.