Skip to contentSkip to conversation

batman-adv: Do not add multicast MAC addresses to translation table

PATCH Applied Linus Lüssing 3 participants 5 messages Oct 17, 2012 – Nov 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Do not add multicast MAC addresses to translation table

The current translation table mechanism is not suitable for multicast addresses and we are currently flooding such frames anyway.

Therefore this patch prevents multicast MAC addresses being added to the translation table.

---
 soft-interface.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
soft-interface.c +2 -1
index 2d1f895..9955319 100644
@@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb,
 		goto dropped;
 
 	/* Register the client MAC in the transtable */
-	batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);
+	if (!is_multicast_ether_addr(ethhdr->h_source))
+		batadv_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 ...
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 16 lines · Linus Lüssing

The current translation table mechanism is not suitable for multicast addresses and we are currently flooding such frames anyway.

Therefore this patch prevents multicast MAC addresses being added to the translation table.

---
 soft-interface.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
soft-interface.c +0 -0
index 2d1f895..9955319 100644

soft-interface.c static int batadv_interface_tx(struct sk_buff *skb, · line 184

Quoted 6 lines
soft-interface.c +2 -1
@@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb,
 		goto dropped;
 
 	/* Register the client MAC in the transtable */
-	batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);
+	if (!is_multicast_ether_addr(ethhdr->h_source))
+		batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);

How can the source address be multicast? Usually multicast addresses are found in the destination field...

Is there any scenario where this is possible? I am wondering whether we should directly drop packet having mcast address as source..

Cheers,

Signature · 4 lines
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
#2 lore raw
Quoted 34 lines

Gesendet: Mittwoch, 17. Oktober 2012 um 15:36 Uhr
Von: "Antonio Quartulli" <[email protected]>
An: "The list for a Better Approach To Mobile Ad-hoc Networking" <[email protected]>
Betreff: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Do not add multicast MAC addresses to translation table

Quoted 16 lines · Linus Lüssing

The current translation table mechanism is not suitable for multicast addresses and we are currently flooding such frames anyway.

Therefore this patch prevents multicast MAC addresses being added to the translation table.

---
 soft-interface.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
soft-interface.c +0 -0
index 2d1f895..9955319 100644

soft-interface.c static int batadv_interface_tx(struct sk_buff *skb, · line 184

Quoted 6 lines
soft-interface.c +2 -1
@@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb,
 		goto dropped;
 
 	/* Register the client MAC in the transtable */
-	batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);
+	if (!is_multicast_ether_addr(ethhdr->h_source))
+		batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);

How can the source address be multicast? Usually multicast addresses are found in the destination field...

Quoted 2 lines

Is there any scenario where this is possible? I am wondering whether we should directly drop packet having mcast address as source..

Hm, no, I do not have a specific scenario in mind. I only accidentally noticed such an FF:FF:FF:FF:FF:FF mac address in our vis graph here when I made a typo with the tool 'mausezahn'.

I don't know of any RFC or so which would generally forbid using a multicast source MAC for every ether type (although for sane IPv4/v6 stacks I haven't seen something like this before either and yes, I bet it's not allowed there).

The Linux bridge I had on top of bat0 was happily forwarding such frames into batman-adv. So I thought doing it like the bridge code - forwarding but with no learning - might be the right way?

Cheers

Quoted 10 lines

Cheers,

Signature · 4 lines
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
#3 lore raw
Quoted 34 lines · Linus Lüssing
Quoted 34 lines

Gesendet: Mittwoch, 17. Oktober 2012 um 15:36 Uhr
Von: "Antonio Quartulli" <[email protected]>
An: "The list for a Better Approach To Mobile Ad-hoc Networking" <[email protected]>
Betreff: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Do not add multicast MAC addresses to translation table

Quoted 16 lines · Linus Lüssing

The current translation table mechanism is not suitable for multicast addresses and we are currently flooding such frames anyway.

Therefore this patch prevents multicast MAC addresses being added to the translation table.

---
 soft-interface.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
soft-interface.c +0 -0
index 2d1f895..9955319 100644

soft-interface.c static int batadv_interface_tx(struct sk_buff *skb, · line 184

Quoted 6 lines
soft-interface.c +2 -1
@@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb,
 		goto dropped;
 
 	/* Register the client MAC in the transtable */
-	batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);
+	if (!is_multicast_ether_addr(ethhdr->h_source))
+		batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);

How can the source address be multicast? Usually multicast addresses are found in the destination field...

Quoted 8 lines
Quoted 2 lines

Is there any scenario where this is possible? I am wondering whether we should directly drop packet having mcast address as source..

Hm, no, I do not have a specific scenario in mind. I only accidentally noticed such an FF:FF:FF:FF:FF:FF mac address in our vis graph here when I made a typo with the tool 'mausezahn'.

I don't know of any RFC or so which would generally forbid using a multicast source MAC for every ether type (although for sane IPv4/v6 stacks I haven't seen something like this before either and yes, I bet it's not allowed there).

The Linux bridge I had on top of bat0 was happily forwarding such frames into batman-adv. So I thought doing it like the bridge code - forwarding but with no learning - might be the right way?

I think you are right. We should not care about the payload logic. If that is not allowed for the upper layer, then that layer will drop the packet once received.

So we should keep forwarding such packets and yes, we should prevent learning from them. Therefore:

Thanks a lot Linüs.
Cheers,

Signature · 4 lines
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
#4 lore raw
Quoted 22 lines · On Thursday, October 18, 2012 02:48:39 Antonio Quartulli wrote:
Quoted 13 lines

Hm, no, I do not have a specific scenario in mind. I only accidentally noticed such an FF:FF:FF:FF:FF:FF mac address in our vis graph here when I made a typo with the tool 'mausezahn'.

I don't know of any RFC or so which would generally forbid using a multicast source MAC for every ether type (although for sane IPv4/v6 stacks I haven't seen something like this before either and yes, I bet it's not allowed there).

Quoted 3 lines

The Linux bridge I had on top of bat0 was happily forwarding such frames into batman-adv. So I thought doing it like the bridge code - forwarding but with no learning - might be the right way?

I think you are right. We should not care about the payload logic. If that is not allowed for the upper layer, then that layer will drop the packet once received.

Quoted 4 lines

So we should keep forwarding such packets and yes, we should prevent learning from them. Therefore:

Applied in revision 9868989.

Thanks,
Marek