summaryrefslogtreecommitdiffstats
path: root/src/privsep-root.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-08-16 19:21:48 +0100
committerRoy Marples <roy@marples.name>2020-08-16 19:21:48 +0100
commit73baf764aeab4b4d3ab575c96fa3a657d1e0cdd2 (patch)
tree30e273a051e20d240b1092830dddd39fe412ef3a /src/privsep-root.c
parente5679c5f411e561c31a30fb9cf730ff54b9242ac (diff)
downloaddhcpcd-73baf764aeab4b4d3ab575c96fa3a657d1e0cdd2.tar.xz
Use a minimum bufsize of 1 as 0 doesn't work on some OS.
Diffstat (limited to 'src/privsep-root.c')
-rw-r--r--src/privsep-root.c6
1 files changed, 3 insertions, 3 deletions
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)