git: 0b77f92575cd - main - in_pcb: Fix RIPCB_HASH in kernels without INET or INET6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Apr 2026 18:37:19 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=0b77f92575cdfecb9920041c7c1d4cc26245e2ec
commit 0b77f92575cdfecb9920041c7c1d4cc26245e2ec
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-04-14 18:25:19 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-04-14 18:25:19 +0000
in_pcb: Fix RIPCB_HASH in kernels without INET or INET6
Only use hashes for protocols that are enabled in the kernel
configuration.
Fixes: ece716c5d347 ("raw ip: move hash table manipulation to inpcb layer")
---
sys/netinet/in_pcb.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index f590d464f0ea..fb52f59ff725 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -591,9 +591,17 @@ VNET_DECLARE(uint32_t, in_pcbhashseed);
#define INP_PCBPORTHASH(lport, mask) (ntohs((lport)) & (mask))
+#if defined(INET) && defined(INET6)
#define RIPCB_HASH(inp) (((inp)->inp_vflag & INP_IPV6) ? \
IN6_ADDR_JHASH32(&(inp)->in6p_faddr) : \
IN_ADDR_JHASH32(&(inp)->inp_faddr))
+#elif defined(INET6)
+#define RIPCB_HASH(inp) \
+ IN6_ADDR_JHASH32(&(inp)->in6p_faddr)
+#else
+#define RIPCB_HASH(inp) \
+ IN_ADDR_JHASH32(&(inp)->inp_faddr)
+#endif
/*
* Flags passed to in_pcblookup*(), inp_smr_lock() and inp_next().