]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Use a minimum bufsize of 1 as 0 doesn't work on some OS.
authorRoy Marples <roy@marples.name>
Sun, 16 Aug 2020 18:21:48 +0000 (19:21 +0100)
committerRoy Marples <roy@marples.name>
Sun, 16 Aug 2020 18:21:48 +0000 (19:21 +0100)
src/privsep-root.c

index fe6b1aa616cd84ddd01dd205fe3f55e4bb23468d..3e2046ad5b49183faf3818e56e52e02def3a7f23 100644 (file)
@@ -645,7 +645,7 @@ ps_root_startcb(void *arg)
         * Reading from it just to drain it is a waste of CPU time. */
 #ifdef INET
        if (ctx->options & DHCPCD_IPV4) {
-               int buflen = 0;
+               int buflen = 1;
 
                ctx->udp_wfd = xsocket(PF_INET,
                    SOCK_RAW | SOCK_CXNB, IPPROTO_UDP);
@@ -658,7 +658,7 @@ ps_root_startcb(void *arg)
 #endif
 #ifdef INET6
        if (ctx->options & DHCPCD_IPV6) {
-               int buflen = 0;
+               int buflen = 1;
 
                ctx->nd_fd = ipv6nd_open(false);
                if (ctx->nd_fd == -1)
@@ -670,7 +670,7 @@ ps_root_startcb(void *arg)
 #endif
 #ifdef DHCP6
        if (ctx->options & DHCPCD_IPV6) {
-               int buflen = 0;
+               int buflen = 1;
 
                ctx->dhcp6_wfd = dhcp6_openraw();
                if (ctx->dhcp6_wfd == -1)