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
This commit is contained in:
parent
338c0bc664
commit
b6e6d918c0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=70532
@ -1341,11 +1341,16 @@ int main(argc, argv)
|
||||
ch = getopt(argc, argv, "i:");
|
||||
if (ch == 'i') {
|
||||
iface = optarg;
|
||||
} else {
|
||||
if (argc > 1 && *argv[1] != '-') {
|
||||
iface = argv[1];
|
||||
optind = 2;
|
||||
} else {
|
||||
iface = "an0";
|
||||
optreset = 1;
|
||||
optind = 1;
|
||||
}
|
||||
optreset = 1;
|
||||
}
|
||||
opterr = 1;
|
||||
|
||||
while ((ch = getopt(argc, argv,
|
||||
|
@ -702,11 +702,16 @@ int main(argc, argv)
|
||||
ch = getopt(argc, argv, "i:");
|
||||
if (ch == 'i') {
|
||||
iface = optarg;
|
||||
} else {
|
||||
if (argc > 1 && *argv[1] != '-') {
|
||||
iface = argv[1];
|
||||
optind = 2;
|
||||
} else {
|
||||
iface = "wi0";
|
||||
optreset = 1;
|
||||
optind = 1;
|
||||
}
|
||||
optreset = 1;
|
||||
}
|
||||
opterr = 1;
|
||||
|
||||
while((ch = getopt(argc, argv,
|
||||
|
Loading…
Reference in New Issue
Block a user