summaryrefslogtreecommitdiffstats
path: root/usr.sbin/wicontrol/wicontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/wicontrol/wicontrol.c')
-rw-r--r--usr.sbin/wicontrol/wicontrol.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.sbin/wicontrol/wicontrol.c b/usr.sbin/wicontrol/wicontrol.c
index fbd81a3..ecbc2ea 100644
--- a/usr.sbin/wicontrol/wicontrol.c
+++ b/usr.sbin/wicontrol/wicontrol.c
@@ -697,6 +697,18 @@ int main(argc, argv)
char *key = NULL;
int modifier = 0;
+ /* Get the interface name */
+ opterr = 0;
+ ch = getopt(argc, argv, "i:");
+ if (ch == 'i') {
+ iface = optarg;
+ } else {
+ iface = "wi0";
+ optreset = 1;
+ optind = 1;
+ }
+ opterr = 1;
+
while((ch = getopt(argc, argv,
"hoc:d:e:f:i:k:p:r:q:t:n:s:m:v:P:S:T:ZC")) != -1) {
switch(ch) {
@@ -720,9 +732,6 @@ int main(argc, argv)
wi_dumpstats(iface);
exit(0);
break;
- case 'i':
- iface = optarg;
- break;
case 'c':
wi_setword(iface, WI_RID_CREATE_IBSS, atoi(optarg));
exit(0);
OpenPOWER on IntegriCloud