From: Johannes Berg <johannes@sipsolutions.net>
To: Alina Friedrichsen <x-alina@gmx.net>
Cc: berlin@berlin.freifunk.net, linux-wireless@vger.kernel.org,
openwrt-devel@lists.openwrt.org, Vladimir Koutny <vlado@ksp.sk>
Subject: Re: mac80211 (ath9k, ath5k, etc.) set BSSID Patch
Date: Tue, 30 Dec 2008 11:39:25 +0100 [thread overview]
Message-ID: <1230633565.3850.7.camel@johannes> (raw)
In-Reply-To: <20081230025651.6500@gmx.net> (sfid-20081230_035657_768921_742B8565)
[-- Attachment #1: Type: text/plain, Size: 2007 bytes --]
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2008-12-30 10:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 2:56 mac80211 (ath9k, ath5k, etc.) set BSSID Patch Alina Friedrichsen
2008-12-30 10:39 ` Johannes Berg [this message]
2008-12-30 22:36 ` Alina Friedrichsen
2008-12-30 22:40 ` Johannes Berg
2008-12-30 23:07 ` Alina Friedrichsen
2009-01-01 22:41 ` mac80211 (ath9k, ath5k, etc.) set fixed BSSID + channel Patch Alina Friedrichsen
2009-01-02 14:29 ` Johannes Berg
2008-12-30 11:37 ` mac80211 (ath9k, ath5k, etc.) set BSSID Patch Jouni Malinen
2008-12-30 16:15 ` Alina Friedrichsen
2008-12-30 16:56 ` Jouni Malinen
2008-12-30 21:20 ` Alina Friedrichsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230633565.3850.7.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=berlin@berlin.freifunk.net \
--cc=linux-wireless@vger.kernel.org \
--cc=openwrt-devel@lists.openwrt.org \
--cc=vlado@ksp.sk \
--cc=x-alina@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).