summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-10-28 23:33:28 +0000
committerjoe <joe@FreeBSD.org>2000-10-28 23:33:28 +0000
commit3a476a0a340b6f8162ee8ca68665a2681fa85ba1 (patch)
treee22c358a57651d4ce7e2d197c12425b269a85b89 /usr.sbin
parentbd721b9e787eda1742cdc75b457d0ed5f0cc4541 (diff)
downloadFreeBSD-src-3a476a0a340b6f8162ee8ca68665a2681fa85ba1.zip
FreeBSD-src-3a476a0a340b6f8162ee8ca68665a2681fa85ba1.tar.gz
Make '-i iface' optional. Assume an0 if it's not otherwise specified.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ancontrol/ancontrol.83
-rw-r--r--usr.sbin/ancontrol/ancontrol.c17
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;
OpenPOWER on IntegriCloud