Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a6ca5f1dbe40470fcb1ecc921769d792a1e77ed9
Commit:     a6ca5f1dbe40470fcb1ecc921769d792a1e77ed9
Parent:     0fe1e567d0b4f6a98e94d3b9a40f41c801bd157f
Author:     Patrick McHardy <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 22:39:28 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Jan 10 22:39:28 2008 -0800

    [MACVLAN]: Prevent nesting macvlan devices
    
    Don't allow to nest macvlan devices since it will cause lockdep
    warnings and isn't really useful for anything.
    
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/macvlan.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 2e4bcd5..e8dc2f4 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to