rt_names: stop allocating 5k in rwdata
[oweals/busybox.git] / networking / udhcp / packet.c
index 85910447baaee8a3bdd12011eef6f88cb3f41a0a..25c55faab1c9d5f7a174bdac2fbd31f5a759ecef 100644 (file)
@@ -1,7 +1,7 @@
 /* vi: set sw=4 ts=4: */
 
 #include <netinet/in.h>
-#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
+#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
 #include <netpacket/packet.h>
 #include <net/ethernet.h>
 #else
@@ -173,7 +173,6 @@ int udhcp_kernel_packet(struct dhcpMessage *payload,
                uint32_t source_ip, int source_port,
                uint32_t dest_ip, int dest_port)
 {
-       int n = 1;
        int fd, result;
        struct sockaddr_in client;
 
@@ -181,7 +180,7 @@ int udhcp_kernel_packet(struct dhcpMessage *payload,
        if (fd < 0)
                return -1;
 
-       if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &n, sizeof(n)) == -1) {
+       if (setsockopt_reuseaddr(fd) == -1) {
                close(fd);
                return -1;
        }