Date: Mon, 23 Feb 2026 13:24:02 +0000 From: Doug Rabson <dfr@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 42d84f475d5c - main - sysutils/conmon: Use send(2) for sequenced packet sockets Message-ID: <699c54f2.470ae.2071f998@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/ports/commit/?id=42d84f475d5c71e86b1fcfcdb2d774ac5725a32f commit 42d84f475d5c71e86b1fcfcdb2d774ac5725a32f Author: Doug Rabson <dfr@FreeBSD.org> AuthorDate: 2026-01-27 14:34:36 +0000 Commit: Doug Rabson <dfr@FreeBSD.org> CommitDate: 2026-02-23 13:23:07 +0000 sysutils/conmon: Use send(2) for sequenced packet sockets Podman container stdout and stderr are proxied through conmon, allowing logging and supporting attaching/detaching from the container. The two output streams are multiplexed on a single SOCK_SEQPACKET unix domain socket. Each packet contains either stdout or stderr data with a small header identifying the stream. On FreeBSD versions prior to FreeBSD-15.0-RELEASE, the write(2) system call implicitly marks each write as a single packet on the stream but in 15.0 and later, this is not the case - packet boundaries must be explicitly marked using send(2). This resulted multiple writes being combined in a single packet and caused Podman to exit with an error (https://github.com/containers/podman/issues/27918). This changes conmon to use send(2) to write the output packets which is compatible with all FreeBSD versions and requires no changes to the Podman side of the connection. --- sysutils/conmon/Makefile | 2 +- sysutils/conmon/sysutils/conmon/files/patch-src_conn__sock.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sysutils/conmon/Makefile b/sysutils/conmon/Makefile index 647b8c588b6f..3cbe944f10a1 100644 --- a/sysutils/conmon/Makefile +++ b/sysutils/conmon/Makefile @@ -1,7 +1,7 @@ PORTNAME= conmon DISTVERSIONPREFIX= v DISTVERSION= 2.1.13 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= sysutils MAINTAINER= dfr@FreeBSD.org diff --git a/sysutils/conmon/sysutils/conmon/files/patch-src_conn__sock.c b/sysutils/conmon/sysutils/conmon/files/patch-src_conn__sock.c new file mode 100644 index 000000000000..2e580c8b5563 --- /dev/null +++ b/sysutils/conmon/sysutils/conmon/files/patch-src_conn__sock.c @@ -0,0 +1,11 @@ +--- src/conn_sock.c.orig 2026-01-23 16:22:04 UTC ++++ src/conn_sock.c +@@ -360,7 +360,7 @@ void write_back_to_remote_consoles(char *buf, int len) + for (int i = local_mainfd_stdin.readers->len; i > 0; i--) { + struct remote_sock_s *remote_sock = g_ptr_array_index(local_mainfd_stdin.readers, i - 1); + +- if (remote_sock->writable && write_all(remote_sock->fd, buf, len) < 0) { ++ if (remote_sock->writable && send(remote_sock->fd, buf, len, MSG_EOR) < 0) { + nwarn("Failed to write to remote console socket"); + remote_sock_shutdown(remote_sock, SHUT_WR); + }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?699c54f2.470ae.2071f998>
