From patchwork Fri Feb 17 07:18:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1541 Return-Path: Received: from nm18.bullet.mail.ukl.yahoo.com (nm18.bullet.mail.ukl.yahoo.com [217.146.183.192]) by open-mesh.org (Postfix) with SMTP id C39DA6007E2 for ; Fri, 17 Feb 2012 08:19:25 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.211] by nm18.bullet.mail.ukl.yahoo.com with NNFMP; 17 Feb 2012 07:19:25 -0000 Received: from [77.238.184.67] by tm4.bullet.mail.ukl.yahoo.com with NNFMP; 17 Feb 2012 07:19:25 -0000 Received: from [127.0.0.1] by smtp136.mail.ukl.yahoo.com with NNFMP; 17 Feb 2012 07:19:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1329463165; bh=vW7XqOmHfmiUrl2l0L6fRQb8+QlJWs7wPBfk3p9lU88=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=VuJA2hcKCbaP6l1RaUwTnzLhvVqTKxUlutaODaoHrHTbrbzrzUWlPchuM4MmF5BkqWcCK9ZAsWdzEBNCCbB0/xvTJMg2tVhRJsqWZbLSO0xbXOHCbPWvPS99NWW2ZAS1txyHaH2m4PCn14dqt78u8ehYJiE51wagG9H+qwIbNO8= X-Yahoo-Newman-Id: 323597.52372.bm@smtp136.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZUi1A18VM1npjScDvkjpU_76pb8LwZOxOd2Kb4E0y0lr27Y wt_x4aKi7adxf6tJF_x_d55XGfGYOr9PF3UtKVFsem4oHBadHzvSoig9OLDm A5NKSu5aoXMfDi8RMR49z0tRIR1H3zRZ5hJs358t9a6PTTSnJwQzI6qGyUa0 w9VbJ.2JywWl6x.qxLbE6JyHwNGq5HQv3ak0zzeSqQktkKT3yo7SVE0udXic gpARJdVMwiZNQIRXYZRRVTfv0_Lbs5erpJCK3iD0cbI0exUggt5uudcqXRZb zeim7l_TA4gMUhbEIdDpovq8XscZw91ihHx3VESWvo9w0JpyP_GBHYlTdejY 61AOk673IDfEx.44WQZfYirJNxuoYC9LpIVcfC6Cpuc0sRDO6JIU4mZx6r2Y 29UCVqQB2pWQM1m5iHVP9YHRz80hBmtsD21dWnZH0iNBLIWIllS_qL0CLKuO w4HP7tKM5lVMNJ4kr3i82ZbVT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@210.177.7.38 with plain) by smtp136.mail.ukl.yahoo.com with SMTP; 17 Feb 2012 07:19:24 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Fri, 17 Feb 2012 15:18:26 +0800 Message-Id: <1329463110-856-7-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1329463110-856-1-git-send-email-lindner_marek@yahoo.de> References: <1329463110-856-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 06/10] batman-adv: warn if added interface is part of a bridge X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 07:19:26 -0000 Signed-off-by: Marek Lindner --- net/batman-adv/hard-interface.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index d3e0e32..68b667c 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -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) {