[v3,08/10] batman-adv: drop STP over batman

Message ID 1327258827-13861-9-git-send-email-siwu@hrz.tu-chemnitz.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Simon Wunderlich Jan. 22, 2012, 7 p.m. UTC
  Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

---
[2011-11-04] always use ETH_ALEN

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 soft-interface.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
  

Comments

Marek Lindner Feb. 6, 2012, 6:42 p.m. UTC | #1
On Monday, January 23, 2012 03:00:25 Simon Wunderlich wrote:
> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

Applied in revision d0d5770.

Thanks,
Marek
  

Patch

diff --git a/soft-interface.c b/soft-interface.c
index 03cbd9b..59c19aa 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -129,6 +129,7 @@  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;
+	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;
@@ -158,6 +159,11 @@  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;