diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-01 21:05:57 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-01 21:05:57 +0400 |
commit | c82b5108e1a40f3b299043770e01d7d7db35de04 (patch) | |
tree | 35039a36868df644b8e5ffc766c1b0c921c88ab5 /networking/udhcp/socket.c | |
parent | dc7a5eae36d31f5cfc301de2499329b8a03ea660 (diff) |
udhcp: new config option "Rewrite the lease file at every new acknowledge"
(Mats Erik Andersson <mats@blue2net.com> (Blue2Net AB))
udhcp: consistently treat server_config.start/end IPs as host-order
fix IP parsing for 64bit machines
fix unsafe hton macro usage in read_opt()
do not chdir("/") when daemonizing
fix help text
Diffstat (limited to 'networking/udhcp/socket.c')
-rw-r--r-- | networking/udhcp/socket.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c index d294fb259..be5985f88 100644 --- a/networking/udhcp/socket.c +++ b/networking/udhcp/socket.c @@ -43,7 +43,7 @@ int read_interface(const char *interface, int *ifindex, uint32_t *addr, uint8_t struct ifreq ifr; struct sockaddr_in *our_ip; - memset(&ifr, 0, sizeof(struct ifreq)); + memset(&ifr, 0, sizeof(ifr)); fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (fd < 0) { bb_perror_msg("socket failed"); @@ -54,7 +54,8 @@ int read_interface(const char *interface, int *ifindex, uint32_t *addr, uint8_t strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name)); if (addr) { if (ioctl(fd, SIOCGIFADDR, &ifr) != 0) { - bb_perror_msg("SIOCGIFADDR failed, is the interface up and configured?"); + bb_perror_msg("SIOCGIFADDR failed (is interface %s " + "up and configured?)", interface); close(fd); return -1; } @@ -117,7 +118,7 @@ int listen_socket(uint32_t ip, int port, const char *inf) return -1; } - if (bind(fd, (struct sockaddr *)&addr, sizeof(struct sockaddr)) == -1) { + if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { close(fd); return -1; } |