Skip to content

Commit

Permalink
batman-adv: warn if added interface is part of a bridge
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
  • Loading branch information
Marek Lindner committed Feb 16, 2012
1 parent a04ccd5 commit 6e242f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6e242f9

Please sign in to comment.