summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ancontrol
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-12-31 01:51:23 +0000
committerimp <imp@FreeBSD.org>2000-12-31 01:51:23 +0000
commitb3e6a27a70b0b59a412a59c50025559273122bb3 (patch)
tree9812a3e1e17fc5d1e9bcdf05a0728e99ef31a408 /usr.sbin/ancontrol
parent48f3847902ba1a79991562090f4bdd5b76c5b0d4 (diff)
downloadFreeBSD-src-b3e6a27a70b0b59a412a59c50025559273122bb3.zip
FreeBSD-src-b3e6a27a70b0b59a412a59c50025559273122bb3.tar.gz
If the first argument doesn't start with '-' assume that it is an
interface. This augments the default to an appropriate interface code. # These programs should be merged into ifconfig, ala NetBSD, but that's # a fight for another day. Idea from: OpenBSD
Diffstat (limited to 'usr.sbin/ancontrol')
-rw-r--r--usr.sbin/ancontrol/ancontrol.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/ancontrol/ancontrol.c b/usr.sbin/ancontrol/ancontrol.c
index 8754063..f069235 100644
--- a/usr.sbin/ancontrol/ancontrol.c
+++ b/usr.sbin/ancontrol/ancontrol.c
@@ -1342,9 +1342,14 @@ int main(argc, argv)
if (ch == 'i') {
iface = optarg;
} else {
- iface = "an0";
+ if (argc > 1 && *argv[1] != '-') {
+ iface = argv[1];
+ optind = 2;
+ } else {
+ iface = "an0";
+ optind = 1;
+ }
optreset = 1;
- optind = 1;
}
opterr = 1;
OpenPOWER on IntegriCloud