lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Dec 2013 20:47:07 +0100
From:	Michal Kubecek <mkubecek@...e.cz>
To:	Vlad Yasevich <vyasevich@...il.com>
Cc:	Kevin Wallace <kevin@...tabarf.net>, netdev@...r.kernel.org
Subject: Re: [PATCH v2] macvlan: Support creating macvtaps from macvlans

On Tue, Dec 03, 2013 at 11:17:37AM -0500, Vlad Yasevich wrote:
> > diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> > index acf9379..cfb9157 100644
> > --- a/drivers/net/macvlan.c
> > +++ b/drivers/net/macvlan.c
> > @@ -820,13 +820,11 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
> >  	if (lowerdev == NULL)
> >  		return -ENODEV;
> >  
> > -	/* When creating macvlans on top of other macvlans - use
> > +	/* When creating macvlans or macvtaps on top of other macvlans - use
> >  	 * the real device as the lowerdev.
> >  	 */
> > -	if (lowerdev->rtnl_link_ops == dev->rtnl_link_ops) {
> > -		struct macvlan_dev *lowervlan = netdev_priv(lowerdev);
> > -		lowerdev = lowervlan->lowerdev;
> > -	}
> > +	if (netif_is_macvlan(lowerdev))
> > +		lowerdev = macvlan_dev_real_dev(lowerdev);
> >  
> >  	if (!tb[IFLA_MTU])
> >  		dev->mtu = lowerdev->mtu;
> > 
> 
> the other question is should this be done in a loop?  What happens if
> you have nested namespaces?

Nested namespaces are not a problem, what would be a problem, would be
having a macvlan (macvtap) device on top of another macvlan. But the
purpose of this particular code is to prevent it and use the underlying
"real" device instead. That's why unlike vlan_dev_real_dev(),
macvlan_dev_real_dev() doesn't need to recurse.

                                                         Michal Kubecek

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ