From: Roy Marples Date: Sun, 16 Aug 2020 18:21:48 +0000 (+0100) Subject: Use a minimum bufsize of 1 as 0 doesn't work on some OS. X-Git-Tag: v9.2.0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73baf764aeab4b4d3ab575c96fa3a657d1e0cdd2;p=thirdparty%2Fdhcpcd.git Use a minimum bufsize of 1 as 0 doesn't work on some OS. --- diff --git a/src/privsep-root.c b/src/privsep-root.c index fe6b1aa6..3e2046ad 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -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)