summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2000-10-13 18:58:11 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2000-10-13 18:58:11 +0000
commitaad9459281d19b327f0588a1da0f9738854e11af (patch)
treec6cb9e2abf510e8dea83b2c03ecd8f3e3d2fb734
parente913882c787243dff8461600c0190779b3157752 (diff)
The -i flags was being ignored, this breaks backwards compatibility
ok deraadt@
-rw-r--r--sbin/ancontrol/ancontrol.c7
-rw-r--r--sbin/wicontrol/wicontrol.c9
2 files changed, 9 insertions, 7 deletions
diff --git a/sbin/ancontrol/ancontrol.c b/sbin/ancontrol/ancontrol.c
index b622b89b51b..564d6f9c2a9 100644
--- a/sbin/ancontrol/ancontrol.c
+++ b/sbin/ancontrol/ancontrol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ancontrol.c,v 1.7 2000/08/17 21:57:38 deraadt Exp $ */
+/* $OpenBSD: ancontrol.c,v 1.8 2000/10/13 18:58:09 chris Exp $ */
/*
* Copyright 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -1120,7 +1120,7 @@ main(argc, argv)
char *argv[];
{
int ch;
- int act = 0;
+ int act = 0, ifspecified = 0;
char *iface = "an0";
int modifier = 0;
void *arg = NULL;
@@ -1130,6 +1130,7 @@ main(argc, argv)
iface = argv[1];
memcpy(&argv[1], &argv[2], argc * sizeof(char *));
argc--;
+ ifspecified = 1;
}
while ((ch = getopt(argc, argv,
@@ -1150,7 +1151,7 @@ main(argc, argv)
#endif
break;
case 'i':
- if (iface == NULL)
+ if (!ifspecified)
iface = optarg;
break;
case 'A':
diff --git a/sbin/wicontrol/wicontrol.c b/sbin/wicontrol/wicontrol.c
index 2ee82f75aa2..00a7f182f56 100644
--- a/sbin/wicontrol/wicontrol.c
+++ b/sbin/wicontrol/wicontrol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wicontrol.c,v 1.11 2000/08/17 21:57:40 deraadt Exp $ */
+/* $OpenBSD: wicontrol.c,v 1.12 2000/10/13 18:58:10 chris Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -66,7 +66,7 @@
static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\
Bill Paul. All rights reserved.";
static const char rcsid[] =
- "@(#) $Id: wicontrol.c,v 1.11 2000/08/17 21:57:40 deraadt Exp $";
+ "@(#) $Id: wicontrol.c,v 1.12 2000/10/13 18:58:10 chris Exp $";
#endif
static void wi_getval __P((char *, struct wi_req *));
@@ -641,12 +641,13 @@ int main(argc, argv)
char *argv[];
{
char *iface = "wi0";
- int ch, p, dumpstats = 0, dumpinfo = 1;
+ int ch, p, dumpstats = 0, dumpinfo = 1, ifspecified = 0;
if (argc > 1 && argv[1][0] != '-') {
iface = argv[1];
memcpy(&argv[1], &argv[2], argc * sizeof(char *));
argc--;
+ ifspecified = 1;
}
while((ch = getopt(argc, argv,
@@ -665,7 +666,7 @@ int main(argc, argv)
dumpstats ++;
break;
case 'i':
- if (iface == NULL)
+ if (!ifspecified)
iface = optarg;
break;
case 'v':