Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Dec 2004 18:49:54 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 66196 for review
Message-ID:  <200412011849.iB1InsSY005588@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=66196

Change 66196 by sam@sam_ebb on 2004/12/01 18:49:02

	o implement "kick all" for setmlme deauth/disassoc
	o correct setmlme deauth/disassoc to send the correct
	  mgmt frame based on the request

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#20 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#20 (text+ko) ====

@@ -1528,6 +1528,22 @@
 	return 0;
 }
 
+static void
+domlme(void *arg, struct ieee80211_node *ni)
+{
+	struct ieee80211com *ic = ni->ni_ic;
+	struct ieee80211req_mlme *mlme = arg;
+
+	if (ni->ni_associd != 0) {
+		IEEE80211_SEND_MGMT(ic, ni,
+			mlme->im_op == IEEE80211_MLME_DEAUTH ?
+				IEEE80211_FC0_SUBTYPE_DEAUTH :
+				IEEE80211_FC0_SUBTYPE_DISASSOC,
+			mlme->im_reason);
+	}
+	ieee80211_node_leave(ic, ni);
+}
+
 static int
 ieee80211_ioctl_setmlme(struct ieee80211com *ic, struct ieee80211req *ireq)
 {
@@ -1576,16 +1592,19 @@
 				mlme.im_reason);
 			break;
 		case IEEE80211_M_HOSTAP:
-			if (ic->ic_sta == NULL)
-				return EINVAL;
-			ni = ieee80211_find_node(ic->ic_sta, mlme.im_macaddr);
-			if (ni == NULL)
-				return EINVAL;
-			IEEE80211_SEND_MGMT(ic, ni,
-			    IEEE80211_FC0_SUBTYPE_DEAUTH,
-			    mlme.im_reason);
-			ieee80211_node_leave(ic, ni);
-			ieee80211_free_node(ni);
+			/* NB: the broadcast address means do 'em all */
+			if (!IEEE80211_ADDR_EQ(mlme.im_macaddr, ic->ic_ifp->if_broadcastaddr)) {
+				if (ic->ic_sta == NULL ||
+				    (ni = ieee80211_find_node(ic->ic_sta,
+						mlme.im_macaddr)) == NULL)
+					return EINVAL;
+				domlme(&mlme, ni);
+				ieee80211_free_node(ni);
+			} else {
+				if (ic->ic_sta != NULL)
+					ieee80211_iterate_nodes(ic->ic_sta,
+						domlme, &mlme);
+			}
 			break;
 		default:
 			return EINVAL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412011849.iB1InsSY005588>