diff options
-rw-r--r-- | usr.sbin/ancontrol/ancontrol.8 | 3 | ||||
-rw-r--r-- | usr.sbin/ancontrol/ancontrol.c | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/ancontrol/ancontrol.8 b/usr.sbin/ancontrol/ancontrol.8 index eae807f..2b22981 100644 --- a/usr.sbin/ancontrol/ancontrol.8 +++ b/usr.sbin/ancontrol/ancontrol.8 @@ -105,7 +105,8 @@ The argument given to .Nm should be the logical interface name associated with the Aironet -device (an0, an1, etc...). +device (an0, an1, etc...). If one isn't specified the device an0 will +be assumed. .Sh OPTIONS The options are as follows: .Bl -tag -width Fl diff --git a/usr.sbin/ancontrol/ancontrol.c b/usr.sbin/ancontrol/ancontrol.c index e2cea7f..22a2323 100644 --- a/usr.sbin/ancontrol/ancontrol.c +++ b/usr.sbin/ancontrol/ancontrol.c @@ -1134,8 +1134,20 @@ int main(argc, argv) void *arg = NULL; char *p = argv[0]; + /* Get the interface name */ + opterr = 0; + ch = getopt(argc, argv, "i:"); + if (ch == 'i') { + iface = optarg; + } else { + iface = "an0"; + optreset = 1; + optind = 1; + } + opterr = 1; + while ((ch = getopt(argc, argv, - "i:ANISCTht:a:o:s:n:v:d:j:b:c:r:p:w:m:l:QZ")) != -1) { + "ANISCTht:a:o:s:n:v:d:j:b:c:r:p:w:m:l:QZ")) != -1) { switch(ch) { case 'Z': #ifdef ANCACHE @@ -1151,9 +1163,6 @@ int main(argc, argv) errx(1, "ANCACHE not available"); #endif break; - case 'i': - iface = optarg; - break; case 'A': act = ACT_DUMPAP; break; |