diff options
Diffstat (limited to 'networking/udhcp/socket.c')
-rw-r--r-- | networking/udhcp/socket.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |