From b3e6a27a70b0b59a412a59c50025559273122bb3 Mon Sep 17 00:00:00 2001 From: imp Date: Sun, 31 Dec 2000 01:51:23 +0000 Subject: 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 --- usr.sbin/ancontrol/ancontrol.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ancontrol') 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; -- cgit v1.1