diff options
author | sam <sam@FreeBSD.org> | 2004-12-31 19:39:25 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2004-12-31 19:39:25 +0000 |
commit | 53f032a130f0a58cb1612d7aa7df15b94e0fc5d8 (patch) | |
tree | dbdfcc6450a20859914c93fd848ff635b2b541de /sbin | |
parent | f06f95dd373089b6df47b1a29717187b91a4c114 (diff) | |
download | FreeBSD-src-53f032a130f0a58cb1612d7aa7df15b94e0fc5d8.zip FreeBSD-src-53f032a130f0a58cb1612d7aa7df15b94e0fc5d8.tar.gz |
o accept deftxkey as a synonym for weptxkey since that is what is
printed for status (allows cut&paste)
o accept undef for the deftxkey/weptxkey so you can reset state
Requested by: phk
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 07b86c9..4a90678 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -265,10 +265,19 @@ set80211wep(const char *val, int d, int s, const struct afswtch *rafp) 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 @@ -1735,6 +1744,7 @@ static struct cmd ieee80211_cmds[] = { 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 */ |