* [PATCH] cfg80211: disallow interfering with stations on non-AP
@ 2009-05-11 12:34 Johannes Berg
2009-05-11 12:43 ` [PATCH v2] " Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-05-11 12:34 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
On non-AP interfaces userspace has no business interfering with
the station management, this can confuse mac80211 (and other
drivers probably wouldn't support it anyway). Allow adding and
removing stations only on AP interfaces.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/nl80211.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- wireless-testing.orig/net/wireless/nl80211.c 2009-05-11 14:30:25.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2009-05-11 14:32:34.000000000 +0200
@@ -1726,6 +1726,10 @@ static int nl80211_new_station(struct sk
if (err)
goto out_rtnl;
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+ dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN)
+ return -EINVAL;
+
err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, ¶ms.vlan);
if (err)
goto out;
@@ -1769,6 +1773,10 @@ static int nl80211_del_station(struct sk
if (err)
goto out_rtnl;
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+ dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN)
+ return -EINVAL;
+
if (!drv->ops->del_station) {
err = -EOPNOTSUPP;
goto out;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] cfg80211: disallow interfering with stations on non-AP
2009-05-11 12:34 [PATCH] cfg80211: disallow interfering with stations on non-AP Johannes Berg
@ 2009-05-11 12:43 ` Johannes Berg
2009-05-27 8:35 ` [PATCH v2 resend] " Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-05-11 12:43 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
On non-AP interfaces userspace has no business interfering with
the station management, this can confuse mac80211 (and other
drivers probably wouldn't support it anyway). Allow adding and
removing stations only on AP interfaces.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Oops.
net/wireless/nl80211.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- wireless-testing.orig/net/wireless/nl80211.c 2009-05-11 14:30:25.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2009-05-11 14:42:05.000000000 +0200
@@ -1726,6 +1726,12 @@ static int nl80211_new_station(struct sk
if (err)
goto out_rtnl;
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+ dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN) {
+ err = -EINVAL;
+ goto out;
+ }
+
err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, ¶ms.vlan);
if (err)
goto out;
@@ -1769,6 +1775,12 @@ static int nl80211_del_station(struct sk
if (err)
goto out_rtnl;
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+ dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN) {
+ err = -EINVAL;
+ goto out;
+ }
+
if (!drv->ops->del_station) {
err = -EOPNOTSUPP;
goto out;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 resend] cfg80211: disallow interfering with stations on non-AP
2009-05-11 12:43 ` [PATCH v2] " Johannes Berg
@ 2009-05-27 8:35 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2009-05-27 8:35 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
On non-AP interfaces userspace has no business interfering with
the station management, this can confuse mac80211 (and other
drivers probably wouldn't support it anyway). Allow adding and
removing stations only on AP interfaces.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/nl80211.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- wireless-testing.orig/net/wireless/nl80211.c 2009-05-26 10:01:42.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2009-05-26 10:01:44.000000000 +0200
@@ -1687,6 +1687,12 @@ static int nl80211_set_station(struct sk
if (err)
goto out_rtnl;
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+ dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN) {
+ err = -EINVAL;
+ goto out;
+ }
+
err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, ¶ms.vlan);
if (err)
goto out;
@@ -1811,6 +1817,12 @@ static int nl80211_del_station(struct sk
goto out;
}
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+ dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN) {
+ err = -EINVAL;
+ goto out;
+ }
+
if (!drv->ops->del_station) {
err = -EOPNOTSUPP;
goto out;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-27 8:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-11 12:34 [PATCH] cfg80211: disallow interfering with stations on non-AP Johannes Berg
2009-05-11 12:43 ` [PATCH v2] " Johannes Berg
2009-05-27 8:35 ` [PATCH v2 resend] " Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox