From patchwork Sat Apr 7 18:49:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1662 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id CB3FE600815 for ; Sat, 7 Apr 2012 20:49:39 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [217.150.252.179] (confino [217.150.252.179]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 925B3C8661; Sat, 7 Apr 2012 18:49:36 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org 925B3C8661 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1333824579; bh=Z8v37x6dhKZQRcmldeQNOdNJ9ehOPjIeBGFJ36nb7UE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=E4pBgFAG4u92Gb62jQZZUe1uIqeVBfkwPL2Ptd98zLpxA9huaMfEbgjeRQzYCHb2v V0eIahySY8TM9lMkINI5B5ckbNxtHYEilP4WFDMGH3RI7861+LOtUxzvjEwJGSZjUb 0kykVPq5BB4vrnzPWW9vzxGl6i5T6s88AwX6fzAk= From: Antonio Quartulli To: davem@davemloft.net Date: Sat, 7 Apr 2012 20:49:56 +0200 Message-Id: <1333824598-27771-15-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 In-Reply-To: <1333824598-27771-1-git-send-email-ordex@autistici.org> References: <1333824598-27771-1-git-send-email-ordex@autistici.org> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Simon Wunderlich Subject: [B.A.T.M.A.N.] [PATCH 14/16] batman-adv: drop STP over batman 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, 07 Apr 2012 18:49:39 -0000 From: Simon Wunderlich Signed-off-by: Simon Wunderlich Signed-off-by: Antonio Quartulli --- net/batman-adv/soft-interface.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 4d639b3..10ab49a 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -130,6 +130,8 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) struct hard_iface *primary_if = NULL; struct bcast_packet *bcast_packet; struct vlan_ethhdr *vhdr; + static const uint8_t stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, 0x00, + 0x00}; unsigned int header_len = 0; int data_len = skb->len, ret; short vid = -1; @@ -159,6 +161,12 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) /* Register the client MAC in the transtable */ tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); + /* don't accept stp packets. STP does not help in meshes. + * better use the bridge loop avoidance ... + */ + if (compare_eth(ethhdr->h_dest, stp_addr)) + goto dropped; + if (is_multicast_ether_addr(ethhdr->h_dest)) { do_bcast = true;