From patchwork Sat Mar 10 22:17:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1614 Return-Path: Received: from nm4-vm0.bullet.mail.ukl.yahoo.com (nm4-vm0.bullet.mail.ukl.yahoo.com [217.146.183.230]) by open-mesh.org (Postfix) with SMTP id BBBBD600853 for ; Sat, 10 Mar 2012 23:18:19 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.209] by nm4.bullet.mail.ukl.yahoo.com with NNFMP; 10 Mar 2012 22:18:19 -0000 Received: from [217.146.182.149] by tm2.bullet.mail.ukl.yahoo.com with NNFMP; 10 Mar 2012 22:18:19 -0000 Received: from [127.0.0.1] by smtp118.mail.ukl.yahoo.com with NNFMP; 10 Mar 2012 22:18:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1331417899; bh=aKQu4Ie6qD23g48hzBzw2uKzr+nFUdh03Qxc0U47Qyg=; 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; b=zm43N67hZp58VLLDKd2BDIrpN/pt4PyPvHZxyPIwwNpFauzH8+fvbJr1PZiXdaDDsabLivaYeOhqP2mdnru+wf+xG9JGcS5hL9EE9ZPNq2M569XTsqGxP8EJD2d1GQ3vNha3jaUs76nD/Jk7JNcEO9WzLGzViGkhX84AXQrp5LE= X-Yahoo-Newman-Id: 520320.71722.bm@smtp118.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FwTY5vkVM1kGOlfLXNFNUK_ogZpE9W8Zdj2fh14nF5q8X4Q brPUnAoEMwJOrYKQB0hpUk6P3zKO291dwmN7iYzLigaQbAg6ndGpT4xA9Nf1 PcwGGiCpNR3J2iY3t2UGFE.ZuAEdcWmXWtbhGKRE.HWjK4WyWcWBjTD5PoZu HY0K.dd3mV5ou5h5oso6vegRd7xOkTQUuFqhUE4TLJbitbqEWGA8ZKnUFChy 7azspjod4iXgKRDmYVZP.gYaDI8IDwWfbRtvPa8oOAE3he8ESRfZ1g7JkHvq E71CyzOg0OKFKmljQt6Z3gtYb2iaTjRB_kSa_Isf17b0z8NsqhXPm0Inmi1Q 7SaupUEp3gxODe7qnHmb9hTmLELrsd0eMOJtMLkcR8hZFsDYYk67dA3zV1Y_ 2jN02A6vGYUzQpf.fAtPICGsLPa3Pj8VthRepSXkR_eUr X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@119.236.110.45 with plain) by smtp118.mail.ukl.yahoo.com with SMTP; 10 Mar 2012 14:18:18 -0800 PST From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 11 Mar 2012 06:17:49 +0800 Message-Id: <1331417873-19354-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.9.1 Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: ignore protocol packets if the interface did not enable this protocol 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: Sat, 10 Mar 2012 22:18:20 -0000 Reported-by: Simon Wunderlich Signed-off-by: Marek Lindner Tested-by: Simon Wunderlich --- bat_iv_ogm.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index eca2b44..819ae49 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -1186,6 +1186,7 @@ out: static int bat_iv_ogm_receive(struct sk_buff *skb, struct hard_iface *if_incoming) { + struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batman_ogm_packet *batman_ogm_packet; struct ethhdr *ethhdr; int buff_pos = 0, packet_len; @@ -1196,6 +1197,11 @@ static int bat_iv_ogm_receive(struct sk_buff *skb, if (!ret) return NET_RX_DROP; + /* did we receive a B.A.T.M.A.N. IV OGM packet on an interface + * that does not have B.A.T.M.A.N. IV enabled ? */ + if (bat_priv->bat_algo_ops->bat_ogm_emit != bat_iv_ogm_emit) + return NET_RX_DROP; + packet_len = skb_headlen(skb); ethhdr = (struct ethhdr *)skb_mac_header(skb); packet_buff = skb->data;