diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-28 00:21:46 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-28 00:21:46 +0000 |
| commit | c2f5b022933dfcf87e4bda1e69d534f0fec918ca (patch) | |
| tree | 4a36dee53c7335d1ea32594587b03a9b01bb2eed | |
| parent | 1fffe38e01e747341cfe921b38a5cffc569e3188 (diff) | |
| download | busybox-w32-c2f5b022933dfcf87e4bda1e69d534f0fec918ca.tar.gz busybox-w32-c2f5b022933dfcf87e4bda1e69d534f0fec918ca.tar.bz2 busybox-w32-c2f5b022933dfcf87e4bda1e69d534f0fec918ca.zip | |
udhcpc: fix my breakage
| -rw-r--r-- | networking/udhcp/script.c | 4 | ||||
| -rw-r--r-- | networking/udhcp/socket.c | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index d44c80b9f..07f68362c 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
| @@ -151,10 +151,9 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
| 151 | envp[j] = xmalloc(sizeof("ip=255.255.255.255")); | 151 | envp[j] = xmalloc(sizeof("ip=255.255.255.255")); |
| 152 | sprintip(envp[j++], "ip=", (uint8_t *) &packet->yiaddr); | 152 | sprintip(envp[j++], "ip=", (uint8_t *) &packet->yiaddr); |
| 153 | 153 | ||
| 154 | |||
| 155 | for (i = 0; dhcp_options[i].code; i++) { | 154 | for (i = 0; dhcp_options[i].code; i++) { |
| 156 | temp = get_option(packet, dhcp_options[i].code); | 155 | temp = get_option(packet, dhcp_options[i].code); |
| 157 | if (temp) | 156 | if (!temp) |
| 158 | continue; | 157 | continue; |
| 159 | envp[j] = xmalloc(upper_length(temp[OPT_LEN - 2], | 158 | envp[j] = xmalloc(upper_length(temp[OPT_LEN - 2], |
| 160 | dhcp_options[i].flags & TYPE_MASK) + strlen(dhcp_options[i].name) + 2); | 159 | dhcp_options[i].flags & TYPE_MASK) + strlen(dhcp_options[i].name) + 2); |
| @@ -205,7 +204,6 @@ void udhcp_run_script(struct dhcpMessage *packet, const char *name) | |||
| 205 | return; | 204 | return; |
| 206 | } else if (pid == 0) { | 205 | } else if (pid == 0) { |
| 207 | /* close fd's? */ | 206 | /* close fd's? */ |
| 208 | |||
| 209 | /* exec script */ | 207 | /* exec script */ |
| 210 | execle(client_config.script, client_config.script, | 208 | execle(client_config.script, client_config.script, |
| 211 | name, NULL, envp); | 209 | name, NULL, envp); |
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c index 92bf4cccf..2bae68f27 100644 --- a/networking/udhcp/socket.c +++ b/networking/udhcp/socket.c | |||
| @@ -53,7 +53,7 @@ int read_interface(char *interface, int *ifindex, uint32_t *addr, uint8_t *arp) | |||
| 53 | ifr.ifr_addr.sa_family = AF_INET; | 53 | ifr.ifr_addr.sa_family = AF_INET; |
| 54 | strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name)); | 54 | strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name)); |
| 55 | if (addr) { | 55 | if (addr) { |
| 56 | if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) { | 56 | if (ioctl(fd, SIOCGIFADDR, &ifr) != 0) { |
| 57 | bb_perror_msg("SIOCGIFADDR failed, is the interface up and configured?"); | 57 | bb_perror_msg("SIOCGIFADDR failed, is the interface up and configured?"); |
| 58 | close(fd); | 58 | close(fd); |
| 59 | return -1; | 59 | return -1; |
| @@ -64,7 +64,7 @@ int read_interface(char *interface, int *ifindex, uint32_t *addr, uint8_t *arp) | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | if (ifindex) { | 66 | if (ifindex) { |
| 67 | if (ioctl(fd, SIOCGIFINDEX, &ifr) == 0) { | 67 | if (ioctl(fd, SIOCGIFINDEX, &ifr) != 0) { |
| 68 | bb_perror_msg("SIOCGIFINDEX failed"); | 68 | bb_perror_msg("SIOCGIFINDEX failed"); |
| 69 | close(fd); | 69 | close(fd); |
| 70 | return -1; | 70 | return -1; |
