Message ID | b920e279472824d78949401e3bc837713d1f54ea.1600770261.git.sd@queasysnail.net |
---|---|
State | New |
Headers | show |
Series | net: iflink and link-netnsid fixes | expand |
On 10/1/20 9:59 AM, Sabrina Dubroca wrote: > Currently, ipvlan devices don't advertise a link-netnsid. We can get > it from the lower device, like macvlan does. > > Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> > --- > drivers/net/ipvlan/ipvlan_main.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c > index 5bca94c99006..a81bb68a5713 100644 > --- a/drivers/net/ipvlan/ipvlan_main.c > +++ b/drivers/net/ipvlan/ipvlan_main.c > @@ -678,6 +678,14 @@ void ipvlan_link_setup(struct net_device *dev) > } > EXPORT_SYMBOL_GPL(ipvlan_link_setup); > > +static struct net *ipvlan_get_link_net(const struct net_device *dev) > +{ > + struct ipvl_dev *ipvlan = netdev_priv(dev); > + struct net_device *phy_dev = ipvlan->phy_dev; > + > + return dev_net(phy_dev); > +} > + > static const struct nla_policy ipvlan_nl_policy[IFLA_IPVLAN_MAX + 1] = > { > [IFLA_IPVLAN_MODE] = { .type = NLA_U16 }, > @@ -691,6 +699,7 @@ static struct rtnl_link_ops ipvlan_link_ops = { > .setup = ipvlan_link_setup, > .newlink = ipvlan_link_new, > .dellink = ipvlan_link_delete, > + .get_link_net = ipvlan_get_link_net, > }; > > int ipvlan_link_register(struct rtnl_link_ops *ops) > This conflicts with a patch in net-next... commit 0bad834ca7bf9999ed9841f2bf9f5f07fbe02136 Author: Taehee Yoo <ap420073@gmail.com> Date: Fri Aug 21 17:47:32 2020 +0000 ipvlan: advertise link netns via netlink I think you should take it as is.
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 5bca94c99006..a81bb68a5713 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -678,6 +678,14 @@ void ipvlan_link_setup(struct net_device *dev) } EXPORT_SYMBOL_GPL(ipvlan_link_setup); +static struct net *ipvlan_get_link_net(const struct net_device *dev) +{ + struct ipvl_dev *ipvlan = netdev_priv(dev); + struct net_device *phy_dev = ipvlan->phy_dev; + + return dev_net(phy_dev); +} + static const struct nla_policy ipvlan_nl_policy[IFLA_IPVLAN_MAX + 1] = { [IFLA_IPVLAN_MODE] = { .type = NLA_U16 }, @@ -691,6 +699,7 @@ static struct rtnl_link_ops ipvlan_link_ops = { .setup = ipvlan_link_setup, .newlink = ipvlan_link_new, .dellink = ipvlan_link_delete, + .get_link_net = ipvlan_get_link_net, }; int ipvlan_link_register(struct rtnl_link_ops *ops)
Currently, ipvlan devices don't advertise a link-netnsid. We can get it from the lower device, like macvlan does. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> --- drivers/net/ipvlan/ipvlan_main.c | 9 +++++++++ 1 file changed, 9 insertions(+)