From: wim torfs <wtorfs@gmail.com>
To: linville@tuxdriver.com
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org
Subject: [PATCH} mac80211: correction of IFTYPE_AP and IFTYPE_AP_VLAN in ieee80211_do_stop
Date: Tue, 06 Jan 2015 13:22:33 +0100 [thread overview]
Message-ID: <54ABD389.8030409@gmail.com> (raw)
While doing a code review, I noticed that in the latest stable version
of the kernel (3.18.1) the functionality of IFTYPE_AP and IFTYPE_AP_VLAN
is switched in ieee80211_do_stop. In the case of IEEE80211_IFTYPE_AP,
the list of devices in sdata->u.ap.vlans are closed, while in the case
of IEEE80211_IFTYPE_AP_VLAN the skbs in sdata->bss->ps->bc_buf are
freed. I believe this should be the other way around.
I found that the error already existed since 3.9.13, but was not yet
present in 3.2. I didn't check any versions between those.
The following patch corrects the above stated error. This correction has
not been tested, it was discovered during a code review.
Signed-off-by: Wim Torfs wtorfs@gmail.com
---
diff -uprN linux-3.18.1.orig/net/mac80211/iface.c
linux-3.18.1.patched/net/mac80211/iface.c
--- linux-3.18.1.orig/net/mac80211/iface.c 2014-12-16 18:39:45.000000000
+0100
+++ linux-3.18.1.patched/net/mac80211/iface.c 2015-01-06
12:49:50.000000000 +0100
@@ -868,7 +868,7 @@ static void ieee80211_do_stop(struct iee
}
/* APs need special treatment */
- if (sdata->vif.type == NL80211_IFTYPE_AP) {
+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
struct ieee80211_sub_if_data *vlan, *tmpsdata;
/* down all dependent devices, that is VLANs */
@@ -876,7 +876,7 @@ static void ieee80211_do_stop(struct iee
u.vlan.list)
dev_close(vlan->dev);
WARN_ON(!list_empty(&sdata->u.ap.vlans));
- } else if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
+ } else if (sdata->vif.type == NL80211_IFTYPE_AP) {
/* remove all packets in parent bc_buf pointing to this dev */
ps = &sdata->bss->ps;
next reply other threads:[~2015-01-06 12:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 12:22 wim torfs [this message]
2015-01-06 12:25 ` [PATCH} mac80211: correction of IFTYPE_AP and IFTYPE_AP_VLAN in ieee80211_do_stop Johannes Berg
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=54ABD389.8030409@gmail.com \
--to=wtorfs@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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).