git: d7e3dafa66cf - main - net/dhcpcd: fails to get address and fails to exit

From: Dries Michiels <driesm_at_FreeBSD.org>
Date: Sat, 01 Nov 2025 09:41:24 UTC
The branch main has been updated by driesm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d7e3dafa66cf79c7299da2428b43242559799838

commit d7e3dafa66cf79c7299da2428b43242559799838
Author:     Gleb Smirnoff <glebius@freebsd.org>
AuthorDate: 2025-11-01 09:37:42 +0000
Commit:     Dries Michiels <driesm@FreeBSD.org>
CommitDate: 2025-11-01 09:41:18 +0000

    net/dhcpcd: fails to get address and fails to exit
    
    PR:     289842
---
 net/dhcpcd/files/patch-src_privsep.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/net/dhcpcd/files/patch-src_privsep.c b/net/dhcpcd/files/patch-src_privsep.c
new file mode 100644
index 000000000000..b9d22affe381
--- /dev/null
+++ b/net/dhcpcd/files/patch-src_privsep.c
@@ -0,0 +1,24 @@
+--- src/privsep.c.orig	2025-06-01 18:40:28 UTC
++++ src/privsep.c
+@@ -934,7 +934,9 @@ ps_sendpsmmsg(struct dhcpcd_ctx *ctx, int fd,
+ 	} else
+ 		iovlen = 1;
+ 
+-	len = writev(fd, iov, iovlen);
++	len = sendmsg(fd,
++	    &(struct msghdr){ .msg_iov = iov, .msg_iovlen = iovlen }, MSG_EOR);
++
+ 	if (len == -1) {
+ 		if (ctx->options & DHCPCD_FORKED &&
+ 		    !(ctx->options & DHCPCD_PRIVSEPROOT))
+@@ -1063,7 +1065,9 @@ ps_sendcmdmsg(int fd, uint16_t cmd, const struct msghd
+ 	    psm.ps_namelen + psm.ps_controllen + psm.ps_datalen + cmsg_padlen;
+ 	if (psm.ps_datalen != 0)
+ 		memcpy(p, msg->msg_iov[0].iov_base, psm.ps_datalen);
+-	return writev(fd, iov, __arraycount(iov));
++	return sendmsg(fd,
++	    &(struct msghdr){ .msg_iov = iov, .msg_iovlen = __arraycount(iov) },
++	    MSG_EOR);
+ 
+ nobufs:
+ 	errno = ENOBUFS;