diff options
author | H. Peter Anvin <hpa@zytor.com> | 2004-08-26 06:03:42 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2004-08-26 06:03:42 +0000 |
commit | 3b36c76ee9fd4c337f61be465ff812b2661429a6 (patch) | |
tree | b3508cde49e06b7c78a7caef0379a91c5729424c | |
parent | 3508680d900252436356c074fb6cf7e3f5787751 (diff) | |
download | klibc-3b36c76ee9fd4c337f61be465ff812b2661429a6.tar.gz |
Fix logic for static IP configuration (patch from olh, massaged by me)klibc-0.171
-rw-r--r-- | ipconfig/main.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ipconfig/main.c b/ipconfig/main.c index dcd767fc3208d..ee5041ce32d6b 100644 --- a/ipconfig/main.c +++ b/ipconfig/main.c @@ -474,6 +474,7 @@ static int parse_device(struct netdev *dev, const char *ip) 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 @@ static int add_all_devices(struct netdev *template) } 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; |