Fix logic for static IP configuration (patch from olh, massaged by me)
diff --git a/ipconfig/main.c b/ipconfig/main.c
index dcd767f..ee5041c 100644
--- a/ipconfig/main.c
+++ b/ipconfig/main.c
@@ -474,6 +474,7 @@
switch (opt) {
case 0:
parse_addr(&dev->ip_addr, ip);
+ dev->caps = 0;
break;
case 1:
parse_addr(&dev->ip_server, ip);
@@ -608,14 +609,16 @@
}
p[i] = '\0';
flags = strtoul(p, NULL, 0);
- /* Heuristic for if this is a reasonable boot interface. This is the same
+ /* Heuristic for if this is a reasonable boot interface.
+ This is the same
logic the in-kernel ipconfig uses... */
if ( !(flags & IFF_LOOPBACK) &&
(flags & (IFF_BROADCAST|IFF_POINTOPOINT)) )
- continue;
- if ((dev = add_device(de->d_name)) == NULL)
- continue;
- bringup_one_dev(template, dev);
+ {
+ if ( !(dev = add_device(de->d_name)) )
+ continue;
+ bringup_one_dev(template, dev);
+ }
}
closedir(d);
return 1;