Fix kbuild bugs noticed by Bernhard Fischer <rep.nop@aon.at>
[oweals/busybox.git] / networking / ifconfig.c
index 7b358c43f06c500121264220cfc2b65a1b28f592..59b6f0acc90d907551169c16a754b4226acfd0bf 100644 (file)
  * IPV6 support added by Bart Visscher <magick@linux-fan.com>
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>            /* strcmp and friends */
-#include <ctype.h>             /* isdigit and friends */
-#include <stddef.h>            /* offsetof */
-#include <unistd.h>
-#include <netdb.h>
-#include <sys/ioctl.h>
 #include <net/if.h>
 #include <net/if_arp.h>
 #include <netinet/in.h>
@@ -329,7 +321,7 @@ int ifconfig_main(int argc, char **argv)
        }
 
        /* Create a channel to the NET kernel. */
-       sockfd = bb_xsocket(AF_INET, SOCK_DGRAM, 0);
+       sockfd = xsocket(AF_INET, SOCK_DGRAM, 0);
 
        /* get interface name */
        safe_strncpy(ifr.ifr_name, *argv, IFNAMSIZ);
@@ -387,7 +379,8 @@ int ifconfig_main(int argc, char **argv)
 
                                                safe_strncpy(host, *argv, (sizeof host));
 #ifdef CONFIG_FEATURE_IPV6
-                                               if ((prefix = strchr(host, '/'))) {
+                                               prefix = strchr(host, '/');
+                                               if (prefix) {
                                                        if (safe_strtoi(prefix + 1, &prefix_len) ||
                                                                (prefix_len < 0) || (prefix_len > 128))
                                                        {