diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 82ea7404f3da..e1f376e0620c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -4624,16 +4624,24 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx) ieee80211_has_fromds(hdr->frame_control)) return false; - /* Accept only frames that are addressed to the NAN cluster + /* + * Accept only frames that are addressed to the NAN cluster * (based on the Cluster ID). From these frames, accept only - * action frames or authentication frames that are addressed to - * the local NAN interface. + * - public action frames, + * - authentication frames to the local address, and + * - robust management frames except disassoc. */ - return memcmp(sdata->u.nan.conf.cluster_id, - hdr->addr3, ETH_ALEN) == 0 && - (ieee80211_is_public_action(hdr, skb->len) || - (ieee80211_is_auth(hdr->frame_control) && - ether_addr_equal(sdata->vif.addr, hdr->addr1))); + if (!ether_addr_equal(sdata->u.nan.conf.cluster_id, hdr->addr3)) + return false; + if (ieee80211_is_public_action(hdr, skb->len)) + return true; + if (ieee80211_is_auth(hdr->frame_control) && + ether_addr_equal(sdata->vif.addr, hdr->addr1)) + return true; + if (!ieee80211_is_disassoc(hdr->frame_control) && + ieee80211_is_robust_mgmt_frame(skb)) + return true; + return false; case NL80211_IFTYPE_NAN_DATA: if (ieee80211_has_tods(hdr->frame_control) || ieee80211_has_fromds(hdr->frame_control))