git: 6b00c652db7f - main - inpcb: make in6_pcbdisconnect() just like in_pcbdisconnect()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Apr 2026 23:24:17 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=6b00c652db7f43c698e8e3a902f266025c3126ac
commit 6b00c652db7f43c698e8e3a902f266025c3126ac
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-04-14 23:23:26 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-04-14 23:23:26 +0000
inpcb: make in6_pcbdisconnect() just like in_pcbdisconnect()
Allow to be passed with already unconnected inpcb.
Fixes: 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4
---
sys/netinet6/in6_pcb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index ad596cf761d2..3750c7040fbc 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -531,6 +531,9 @@ in6_pcbdisconnect(struct inpcb *inp)
KASSERT(inp->inp_smr == SMR_SEQ_INVALID,
("%s: inp %p was already disconnected", __func__, inp));
+ if (inp->inp_flags & INP_UNCONNECTED)
+ return;
+
INP_HASH_WLOCK(inp->inp_pcbinfo);
in_pcbremhash(inp);
inp->inp_flags |= INP_UNCONNECTED;