PERFORCE change 67377 for review
Sam Leffler
sam at FreeBSD.org
Sun Dec 19 22:18:52 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=67377
Change 67377 by sam at 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 */
More information about the p4-projects
mailing list