Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: refuse invalid interface configuration
@ 2008-09-16 18:32 Johannes Berg
  2008-09-16 18:34 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2008-09-16 18:32 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

Refuse setting mesh_id on non-mesh or monitor flags on non-monitor
interfaces.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/cfg.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

--- everything.orig/net/mac80211/cfg.c	2008-09-16 20:24:53.000000000 +0200
+++ everything/net/mac80211/cfg.c	2008-09-16 20:28:14.000000000 +0200
@@ -105,14 +105,21 @@ static int ieee80211_change_iface(struct
 	if (netif_running(sdata->dev))
 		return -EBUSY;
 
-	if (ieee80211_vif_is_mesh(&sdata->vif) && params->mesh_id_len)
-		ieee80211_sdata_set_mesh_id(sdata,
-					    params->mesh_id_len,
-					    params->mesh_id);
+	if (params->mesh_id_len) {
+		if (ieee80211_vif_is_mesh(&sdata->vif))
+			ieee80211_sdata_set_mesh_id(sdata,
+						    params->mesh_id_len,
+						    params->mesh_id);
+		else
+			return -EINVAL;
+	}
 
-	if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags)
+	if (!flags)
 		return 0;
 
+	if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
+		return -EINVAL;
+
 	sdata->u.mntr_flags = *flags;
 	return 0;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: refuse invalid interface configuration
  2008-09-16 18:32 [PATCH] mac80211: refuse invalid interface configuration Johannes Berg
@ 2008-09-16 18:34 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-09-16 18:34 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

On Tue, 2008-09-16 at 20:32 +0200, Johannes Berg wrote:
> Refuse setting mesh_id on non-mesh or monitor flags on non-monitor
> interfaces.

Hmm, know what, ignore this patch, I'll do it in cfg80211 instead.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-16 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-16 18:32 [PATCH] mac80211: refuse invalid interface configuration Johannes Berg
2008-09-16 18:34 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox