diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-04-14 18:25:19 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-04-14 18:25:19 +0000 |
| commit | 0b77f92575cdfecb9920041c7c1d4cc26245e2ec (patch) | |
| tree | ef1391ccd80492f76482deebc18e80f53d36003a | |
| parent | 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 (diff) | |
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")
| -rw-r--r-- | sys/netinet/in_pcb.h | 8 |
1 files changed, 8 insertions, 0 deletions
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(). |
