git: 3abd3d3cf3f0 - main - inpcb: return ENOMEM if bind(2) fails to allocate lbgroup
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Jul 2026 19:08:16 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=3abd3d3cf3f034cb3d4250a95a8d6c41e72971ef
commit 3abd3d3cf3f034cb3d4250a95a8d6c41e72971ef
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-07-15 18:49:32 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-07-15 19:07:53 +0000
inpcb: return ENOMEM if bind(2) fails to allocate lbgroup
This is exactly the same as the second part of IPv4's change
136c5e17b61a1/D49153.
---
sys/netinet6/in6_pcb.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index b5859777eee9..fc4cd3c9b1ad 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -137,10 +137,11 @@ in6_pcbsetport_locked(struct in6_addr *laddr, struct inpcb *inp,
return (error);
inp->inp_lport = lport;
- if (in_pcbinshash(inp) != 0) {
+ if (__predict_false((error = in_pcbinshash(inp)) != 0)) {
+ MPASS(inp->inp_socket->so_options & SO_REUSEPORT_LB);
inp->in6p_laddr = in6addr_any;
inp->inp_lport = 0;
- return (EAGAIN);
+ return (error);
}
inp->inp_flags |= INP_ANONPORT;
@@ -361,12 +362,13 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr_in6 *sin6, int flags,
}
} else {
inp->inp_lport = lport;
- if (in_pcbinshash(inp) != 0) {
+ if (__predict_false((error = in_pcbinshash(inp)) != 0)) {
+ MPASS(inp->inp_socket->so_options & SO_REUSEPORT_LB);
INP_HASH_WUNLOCK(inp->inp_pcbinfo);
inp->inp_flags &= ~INP_BOUNDFIB;
inp->in6p_laddr = in6addr_any;
inp->inp_lport = 0;
- return (EAGAIN);
+ return (error);
}
}
INP_HASH_WUNLOCK(inp->inp_pcbinfo);