From patchwork Thu Sep 22 18:57:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1261 Return-Path: Received: from nm16-vm0.bullet.mail.ukl.yahoo.com (nm16-vm0.bullet.mail.ukl.yahoo.com [217.146.183.254]) by open-mesh.org (Postfix) with SMTP id 1B31A6006D6 for ; Thu, 22 Sep 2011 20:57:29 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.181] by nm16.bullet.mail.ukl.yahoo.com with NNFMP; 22 Sep 2011 18:57:28 -0000 Received: from [77.238.184.51] by tm12.bullet.mail.ukl.yahoo.com with NNFMP; 22 Sep 2011 18:57:28 -0000 Received: from [127.0.0.1] by smtp120.mail.ukl.yahoo.com with NNFMP; 22 Sep 2011 18:57:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1316717848; bh=UjYZJxQ5yr69HqA7UUWo1eg4+eWceL8w0kUhtqG4Lqw=; 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=w11/jebsGmQ66hKnlt+kGx0G4byIcOGgfg7zZ75SnwS8Cy/eIfcE2fuvF4KuG4GJYSWKK+mqjRU8uWj0GWMj+X2SoQFb1D+oUNET5u3mCueIIRn6cTCp/LELV2vuyv+MTCZgR6IfPR1rwaoARZ1Vc+PGp5EH48LITSpbAiU6r3E= X-Yahoo-Newman-Id: 901655.40815.bm@smtp120.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8sY1IL0VM1mrnA0fuTlF8IEt5.Wd29S0XwUGOZzKRJJXHSe filzYRnzlIyAMT2wuTMJCNyg8jJHA3pn29PPfgJk5ipaQHlhPcyw0zDWNP.0 QMp8zd7kZwLWhUf_s3m5zdHF7tLWpTz4UlL8tSVxi3Apt0kCuRfKGDff_EVo Xt26UxJSYvE6uKDbznNcCxloROGuwvw920QdIz6jdM47MbCCB94I_JY8oYzC X83T72UhHxzibNo54UFH0Ijg6Ob0NDjFIoU6G6agK6X0DCOeg9tajaeTdowJ pirkh.KU3ABq4rS5y6B_Ezm11t8knfvMVhGcNh0EbeDvHiBCiIbS0IcK8QtH NLFmE5rzxciYnN6qxF0k7MuZLhfwemb0s6tr765R0meKVL5Uyi91Wsxc- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@78.46.248.235 with plain) by smtp120.mail.ukl.yahoo.com with SMTP; 22 Sep 2011 18:57:28 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Thu, 22 Sep 2011 20:57:16 +0200 Message-Id: <1316717836-19374-2-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1316717836-19374-1-git-send-email-lindner_marek@yahoo.de> References: <1316717836-19374-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] batman-adv: do_bcast has to be true for broadcast packets only 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: Thu, 22 Sep 2011 18:57:29 -0000 From: Antonio Quartulli corrects a critical bug of the GW feature. This bug made all the unicast packets destined to a GW to be sent as broadcast. This bug is present even if the sender GW feature is configured as OFF. It's an urgent bug fix and should be committed as soon as possible. This was a regression introduced by 43676ab590c3f8686fd047d34c3e33803eef71f0 Signed-off-by: Antonio Quartulli Signed-off-by: Marek Lindner --- net/batman-adv/soft-interface.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 3e2f91f..05dd351 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -565,7 +565,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) struct orig_node *orig_node = NULL; int data_len = skb->len, ret; short vid = -1; - bool do_bcast = false; + bool do_bcast; if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE) goto dropped; @@ -598,15 +598,15 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) tt_local_add(soft_iface, ethhdr->h_source); orig_node = transtable_search(bat_priv, ethhdr->h_dest); - if (is_multicast_ether_addr(ethhdr->h_dest) || - (orig_node && orig_node->gw_flags)) { + do_bcast = is_multicast_ether_addr(ethhdr->h_dest); + if (do_bcast || (orig_node && orig_node->gw_flags)) { ret = gw_is_target(bat_priv, skb, orig_node); if (ret < 0) goto dropped; - if (ret == 0) - do_bcast = true; + if (ret) + do_bcast = false; } /* ethernet packet should be broadcasted */