Skip to content

Commit 9e471ba

Browse files
authored
Merge pull request #638 from jnovy/freebsd
Fix FreeBSD 15.0+ SOCK_SEQPACKET message boundary issue
2 parents 03a41b6 + ec54d8f commit 9e471ba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/conn_sock.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,11 @@ void write_back_to_remote_consoles(char *buf, int len)
363363
for (int i = local_mainfd_stdin.readers->len; i > 0; i--) {
364364
struct remote_sock_s *remote_sock = g_ptr_array_index(local_mainfd_stdin.readers, i - 1);
365365

366+
#ifdef __FreeBSD__
367+
if (remote_sock->writable && send(remote_sock->fd, buf, len, MSG_EOR) < 0) {
368+
#else
366369
if (remote_sock->writable && write_all(remote_sock->fd, buf, len) < 0) {
370+
#endif
367371
nwarn("Failed to write to remote console socket");
368372
remote_sock_shutdown(remote_sock, SHUT_WR);
369373
}

0 commit comments

Comments
 (0)