diff options
Diffstat (limited to 'networking')
| -rw-r--r-- | networking/ifconfig.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index b884ef7c3..4e3df2982 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | * Foundation; either version 2 of the License, or (at | 15 | * Foundation; either version 2 of the License, or (at |
| 16 | * your option) any later version. | 16 | * your option) any later version. |
| 17 | * | 17 | * |
| 18 | * $Id: ifconfig.c,v 1.29 2004/03/15 08:28:48 andersen Exp $ | 18 | * $Id: ifconfig.c,v 1.30 2004/03/31 11:30:08 andersen Exp $ |
| 19 | * | 19 | * |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <string.h> /* strcmp and friends */ | 37 | #include <string.h> /* strcmp and friends */ |
| 38 | #include <ctype.h> /* isdigit and friends */ | 38 | #include <ctype.h> /* isdigit and friends */ |
| 39 | #include <stddef.h> /* offsetof */ | 39 | #include <stddef.h> /* offsetof */ |
| 40 | #include <netdb.h> | ||
| 40 | #include <sys/ioctl.h> | 41 | #include <sys/ioctl.h> |
| 41 | #include <net/if.h> | 42 | #include <net/if.h> |
| 42 | #include <net/if_arp.h> | 43 | #include <net/if_arp.h> |
| @@ -443,8 +444,13 @@ int ifconfig_main(int argc, char **argv) | |||
| 443 | #endif | 444 | #endif |
| 444 | } else if (inet_aton(host, &sai.sin_addr) == 0) { | 445 | } else if (inet_aton(host, &sai.sin_addr) == 0) { |
| 445 | /* It's not a dotted quad. */ | 446 | /* It's not a dotted quad. */ |
| 446 | ++goterr; | 447 | struct hostent *hp; |
| 447 | continue; | 448 | if ((hp = gethostbyname(host)) == (struct hostent *)NULL) { |
| 449 | ++goterr; | ||
| 450 | continue; | ||
| 451 | } | ||
| 452 | memcpy((char *) &sai.sin_addr, (char *) hp->h_addr_list[0], | ||
| 453 | sizeof(struct in_addr)); | ||
| 448 | } | 454 | } |
| 449 | #ifdef CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS | 455 | #ifdef CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS |
| 450 | if (mask & A_HOSTNAME) { | 456 | if (mask & A_HOSTNAME) { |
