summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-01-09 15:30:39 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-01-09 15:30:39 +0000
commit77ef35081ba0e02d76f77b9fbeed7f6b533187e6 (patch)
treeadd46312a82ca0af6693001c66a677b691c3e3f8
parent6a01ba42f060ba2bde4ace5407eb15834c378cc2 (diff)
If the loop check in somove(9) goes to release without setting an
error, a broadcast mbuf will stay in the socket buffer forever. This is bad as multiple mbufs can use up all the space. Better report ELOOP, dissolve splicing, and let userland handle it. OK anton@
-rw-r--r--sys/kern/uipc_socket.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index edc2b1495a0..bf9ecaff692 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.252 2020/12/25 12:59:52 visa Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.253 2021/01/09 15:30:38 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1451,8 +1451,7 @@ somove(struct socket *so, int wait)
if ((m->m_flags & M_PKTHDR) &&
((m->m_pkthdr.ph_loopcnt++ >= M_MAXLOOP) ||
((m->m_flags & M_LOOP) && (m->m_flags & (M_BCAST|M_MCAST))))) {
- if (m->m_pkthdr.ph_loopcnt >= M_MAXLOOP)
- error = ELOOP;
+ error = ELOOP;
goto release;
}