Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Dec 2004 06:18:51 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 67377 for review
Message-ID:  <200412200618.iBK6IpGJ013310@repoman.freebsd.org>

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

Change 67377 by sam@sam_ebb on 2004/12/20 06:17:50

	o add deftxkey pseudonym for weptxkey to be consistent with
	  what is displayed by status
	o recognize "undef" or "-" to mean set the default tx key to
	  be undefined

Affected files ...

.. //depot/projects/wifi/sbin/ifconfig/ifieee80211.c#33 edit

Differences ...

==== //depot/projects/wifi/sbin/ifconfig/ifieee80211.c#33 (text+ko) ====

@@ -265,10 +265,19 @@
 	set80211(s, IEEE80211_IOC_WEP, d, 0, NULL);
 }
 
+static int
+isundefarg(const char *arg)
+{
+	return (strcmp(arg, "-") == 0 || strncasecmp(arg, "undef", 5) == 0);
+}
+
 static void
 set80211weptxkey(const char *val, int d, int s, const struct afswtch *rafp)
 {
-	set80211(s, IEEE80211_IOC_WEPTXKEY, atoi(val)-1, 0, NULL);
+	if (isundefarg(val))
+		set80211(s, IEEE80211_IOC_WEPTXKEY, IEEE80211_KEYIX_NONE, 0, NULL);
+	else
+		set80211(s, IEEE80211_IOC_WEPTXKEY, atoi(val)-1, 0, NULL);
 }
 
 static void
@@ -1733,6 +1742,7 @@
 	DEF_CMD_ARG("wepmode",		set80211wepmode),
 	DEF_CMD("wep",		1,	set80211wep),
 	DEF_CMD("-wep",		0,	set80211wep),
+	DEF_CMD_ARG("deftxkey",		set80211weptxkey),
 	DEF_CMD_ARG("weptxkey",		set80211weptxkey),
 	DEF_CMD_ARG("wepkey",		set80211wepkey),
 	DEF_CMD_ARG("nwkey",		set80211nwkey),		/* NetBSD */



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