X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fmacvlan.c;h=e8dc2f44fec960d9d3b58127699e5a4ed9eee838;hb=444ad82bc3eaa554be40d22dc248e58aeefd54d9;hp=2e4bcd5654c4c0b62db0e795f87c96d73c176207;hpb=f4921aff5b174349bc36551f142a5dbac782ea3f;p=linux-2.6 diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 2e4bcd5654..e8dc2f44fe 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -384,6 +384,13 @@ static int macvlan_newlink(struct net_device *dev, if (lowerdev == NULL) return -ENODEV; + /* Don't allow macvlans on top of other macvlans - its not really + * wrong, but lockdep can't handle it and its not useful for anything + * you couldn't do directly on top of the real device. + */ + if (lowerdev->rtnl_link_ops == dev->rtnl_link_ops) + return -ENODEV; + if (!tb[IFLA_MTU]) dev->mtu = lowerdev->mtu; else if (dev->mtu > lowerdev->mtu)