* 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>
}
/* 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);
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))
{