diff mbox

oops on cloned-mac 802.11s stations

Message ID 1513677938.26145.12.camel@sipsolutions.net (mailing list archive)
State RFC
Delegated to: Kalle Valo
Headers show

Commit Message

Johannes Berg Dec. 19, 2017, 10:05 a.m. UTC
On Mon, 2017-12-18 at 03:44 +0100, Gui Iribarren wrote:
> Steps to reproduce:
> join a 802.11s mesh with a nodeA, and then join the same 802.11s mesh
> with another nodeB, so that both nodes MAC addresses are exactly the
> same (i.e. nodeB is "cloning" nodeA MAC)
> 
> Expected result:
> nodeA and nodeB coexist in a conflicting state, silently
> (not saying that this is a desired scenario, of course; just came across
> this while testing radios that accidentally had the same (fake) address.
> the warning might ring a bell to someone, so reporting it here just for
> the record)
> 
> What actually happens:
> both on nodeA and nodeB, the log is flooded with these warnings:

That's hardly an "oops", but yeah, not nice.

Somewhere we should drop packets if they appear to come from ourselves.
Perhaps like this:


johannes

Comments

Thomas Pedersen Dec. 22, 2017, 6:34 p.m. UTC | #1
On Tue, Dec 19, 2017 at 2:05 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2017-12-18 at 03:44 +0100, Gui Iribarren wrote:
>> Steps to reproduce:
>> join a 802.11s mesh with a nodeA, and then join the same 802.11s mesh
>> with another nodeB, so that both nodes MAC addresses are exactly the
>> same (i.e. nodeB is "cloning" nodeA MAC)
>>
>> Expected result:
>> nodeA and nodeB coexist in a conflicting state, silently
>> (not saying that this is a desired scenario, of course; just came across
>> this while testing radios that accidentally had the same (fake) address.
>> the warning might ring a bell to someone, so reporting it here just for
>> the record)
>>
>> What actually happens:
>> both on nodeA and nodeB, the log is flooded with these warnings:
>
> That's hardly an "oops", but yeah, not nice.
>
> Somewhere we should drop packets if they appear to come from ourselves.
> Perhaps like this:
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index b3cff69bfd66..fd580614085b 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -3625,6 +3625,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
>                 }
>                 return true;
>         case NL80211_IFTYPE_MESH_POINT:
> +               if (ether_addr_equal(sdata->vif.addr, hdr->addr2))
> +                       return false;
>                 if (multicast)
>                         return true;
>                 return ether_addr_equal(sdata->vif.addr, hdr->addr1);

Makes sense.
diff mbox

Patch

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b3cff69bfd66..fd580614085b 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3625,6 +3625,8 @@  static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
 		}
 		return true;
 	case NL80211_IFTYPE_MESH_POINT:
+		if (ether_addr_equal(sdata->vif.addr, hdr->addr2))
+			return false;
 		if (multicast)
 			return true;
 		return ether_addr_equal(sdata->vif.addr, hdr->addr1);