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: 116000 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B373DB6F80 for ; Fri, 23 Sep 2011 04:57:36 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753544Ab1IVS5b (ORCPT ); Thu, 22 Sep 2011 14:57:31 -0400 Received: from nm16-vm0.bullet.mail.ukl.yahoo.com ([217.146.183.254]:38755 "HELO nm16-vm0.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753529Ab1IVS5a (ORCPT ); Thu, 22 Sep 2011 14:57:30 -0400 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 Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli , Marek Lindner Subject: [PATCH] batman-adv: do_bcast has to be true for broadcast packets only 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> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 */