Hi Alina, > #endif /* CONFIG_MAC80211_IBSS_DEBUG */ > if (beacon_timestamp > rx_timestamp) { > + if (memcmp(sdata->u.sta.bssid, mgmt->bssid, ETH_ALEN) != 0) { > #ifdef CONFIG_MAC80211_IBSS_DEBUG > - printk(KERN_DEBUG "%s: beacon TSF higher than " > - "local TSF - IBSS merge with BSSID %s\n", > - sdata->dev->name, print_mac(mac, mgmt->bssid)); > + printk(KERN_DEBUG "%s: beacon TSF higher than " > + "local TSF - IBSS merge with BSSID %s\n", > + sdata->dev->name, print_mac(mac, mgmt->bssid)); > #endif > - ieee80211_sta_join_ibss(sdata, &sdata->u.sta, bss); > - ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, supp_rates); > + ieee80211_sta_join_ibss(sdata, &sdata->u.sta, bss); > + ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, supp_rates); > + } > } Can you move the memcmp() into the other condition to avoid indenting twice please? Also, it seems there needs to be a STA_BSSID_SET exclusion somewhere above to avoid doing merges? > @@ -2576,11 +2582,14 @@ > { > struct ieee80211_if_sta *ifsta; > int res; > + int valid; please use a bool for that > ifsta = &sdata->u.sta; > + valid = is_valid_ether_addr(bssid); > > if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { > - memcpy(ifsta->bssid, bssid, ETH_ALEN); > + if(valid) memcpy(ifsta->bssid, bssid, ETH_ALEN); > + else memset(ifsta->bssid, 0, ETH_ALEN); > res = 0; and indent these properly I won't comment on the actual code right now, the IBSS code is pretty much unknown to me and I don't use it. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part