git: 9b588ef15f47 - main - bsnmpd: use MSG_NOSIGNAL when doing send(2) on a local socket
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 17 Jul 2025 16:01:49 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=9b588ef15f47900ff77419eaf2817ce62fb58a14
commit 9b588ef15f47900ff77419eaf2817ce62fb58a14
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-07-17 16:00:26 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-07-17 16:00:26 +0000
bsnmpd: use MSG_NOSIGNAL when doing send(2) on a local socket
Otherwise in unix/stream mode a disconnected client will crash the
server.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51355
---
contrib/bsnmp/snmpd/trans_lsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/bsnmp/snmpd/trans_lsock.c b/contrib/bsnmp/snmpd/trans_lsock.c
index fa3bd34d14f0..ca2311be7cc3 100644
--- a/contrib/bsnmp/snmpd/trans_lsock.c
+++ b/contrib/bsnmp/snmpd/trans_lsock.c
@@ -417,7 +417,7 @@ lsock_send(struct tport *tp, const u_char *buf, size_t len,
}
}
- return (sendto(peer->input.fd, buf, len, 0, addr, addrlen));
+ return (sendto(peer->input.fd, buf, len, MSG_NOSIGNAL, addr, addrlen));
}
static void