diff options
author | Kevin Wallace <kevin@pentabarf.net> | 2013-12-03 11:55:22 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-06 01:59:02 +0100 |
commit | d70f2cf520cf8c86c6b467fc5dcea524ec51dc2f (patch) | |
tree | 6292f59d2e2c816673cb8af81edb93e049f410ee /drivers/net/macvlan.c | |
parent | Merge branch 'siocghwtstamp' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff) | |
download | linux-d70f2cf520cf8c86c6b467fc5dcea524ec51dc2f.tar.xz linux-d70f2cf520cf8c86c6b467fc5dcea524ec51dc2f.zip |
macvlan: Support creating macvtaps from macvlans
When running in a network namespace whose only link to the outside
world is a macvlan device, not being able to create a macvtap off of
it is a real pain.
So modify macvtap creation to automatically forward a creation of a
macvtap on a macvlan to become a creation of a macvtap on the
underlying network device, just like is currently done with
macvlan-on-macvlan devices.
v2: Use netif_is_macvlan and macvlan_dev_real_dev helpers to make it
more clear what we're doing.
Signed-off-by: Kevin Wallace <kevin@pentabarf.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index acf93798dc67..cfb91570cddd 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; |