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
48f3847902
commit
b3e6a27a70
@ -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;
|
||||
|
||||
|
@ -703,9 +703,14 @@ int main(argc, argv)
|
||||
if (ch == 'i') {
|
||||
iface = optarg;
|
||||
} else {
|
||||
iface = "wi0";
|
||||
if (argc > 1 && *argv[1] != '-') {
|
||||
iface = argv[1];
|
||||
optind = 2;
|
||||
} else {
|
||||
iface = "wi0";
|
||||
optind = 1;
|
||||
}
|
||||
optreset = 1;
|
||||
optind = 1;
|
||||
}
|
||||
opterr = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user