]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
batman-adv: warn if added interface is part of a bridge
authorMarek Lindner <lindner_marek@yahoo.de>
Wed, 7 Dec 2011 10:02:50 +0000 (18:02 +0800)
committerMarek Lindner <lindner_marek@yahoo.de>
Thu, 16 Feb 2012 18:50:19 +0000 (02:50 +0800)
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
net/batman-adv/hard-interface.c

index d3e0e32e51c6f80edbaf3aa6e211eea6ad18ffa0..68b667c1d85e1f7452161839fa6d5a4aa82ab41c 100644 (file)
@@ -281,6 +281,14 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
        if (!atomic_inc_not_zero(&hard_iface->refcount))
                goto out;
 
+       /* hard-interface is part of a bridge */
+       if (hard_iface->net_dev->priv_flags & IFF_BRIDGE_PORT)
+               pr_err("You are about to enable batman-adv on '%s' which "
+                      "already is part of a bridge. Unless you know exactly "
+                      "what you are doing this is probably wrong and won't "
+                      "work the way you think it would.\n",
+                      hard_iface->net_dev->name);
+
        soft_iface = dev_get_by_name(&init_net, iface_name);
 
        if (!soft_iface) {