From nobody Wed Apr 29 16:19:34 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g5MvV5h5Kz6btk3 for ; Wed, 29 Apr 2026 16:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g5MvV5PDMz3lW3 for ; Wed, 29 Apr 2026 16:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777479574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6SPOodW7TmTsC4uf1CpoemSuuBkgE8+r/5/0WQd9ck=; b=B86Hlxp2PqhmIF9hIL9zjCFHJQs/0JXhE8Iol55wcPRk79uju/tTKAr/Do/1RDa2P0frb3 8IpEfIXzDfHZaJlzhxd+fgTdC3j3A1Tt+VFnl9YfIkPmoPdXT7XDSDAIAZUoAFmpeCmgrQ 0LSMM3QHydHJgAZQT8iYWslEVroDiQzkD3D6KkiOWJfCQ1QQXa5HVQzfkNJkmItrRV2K8u BlqMpED6hvfxgeEs9Z0cdU8nDpmXaPuaxQ2f1OGd5JwiGcMDeSj9cvU3wJ2PYm//ZAZ+nh oJNXL6awVrY+8Snm+Hwqg5yS8pNAj5VblFUXisr3fddBDUfR3246wViIg3iROA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777479574; a=rsa-sha256; cv=none; b=i6V2D90/zhI8x97g3HqTYlEBS9MvKDA0XueQxMbAX9g/SGOhsE3OXCSSN6TTUQ/Gmrl86C kbLUeZAn+3EkCIG/g49wyE/7TvKOUt10dwWk8SVsavovF9dqnFfYLu3UBunMsBC1D200TA WW+etaJrbOqQKp59cyTCCHE38/g8ndaDqQWMnNBTxTNh79d6WWQhYHYQIKi2lRHINPaSQG ugB/hvdimxg2BCDz7i9MnPOhaoXv5s9S9Kz4S9AQJHGuHFv6IlBZz4/8t0R3MqTmuybfGf IBG/ldNUayLvzw8dbmQDVqok5x20JJDNPt4nC3ezXwq5fWrvdFpibooQmdvewA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777479574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6SPOodW7TmTsC4uf1CpoemSuuBkgE8+r/5/0WQd9ck=; b=vbr3t3W/msc2+g3A8Yp7vId05VxBS1rL+VVMZvYVU/Ok0BsvttjfMGb2YkH/qNrU9gk3Ov PQscobdnFAmCGq6D1u8BbMhjttvZrzysiH1mGNcyG4IneNE4TsMHWuf54NgcWsfPLpMCtJ Ws1qQwF+fg0PDiWXSw495+EgM2BIwJTPjKJv5geEWxWSQpOxHsyxgbWVv8oAToFDPAtLDo iJHSgJYo8oUfuxABjvmGn7xKZONwt+LcOGiDUB2YirFp/jOCUwItguA8Da7J8WRsyUczIS ElurX5g5VivwPAUWEzv6dHwIRnG3LuQpA6kaAacdGMw4q9IiqLCwik0va5JqNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g5MvV4fM9znqF for ; Wed, 29 Apr 2026 16:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ed18 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 29 Apr 2026 16:19:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9b8eb70ca974 - main - inpcb: improve some internal function names List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b8eb70ca974c2c700f228adaceb9a6b9e918d00 Auto-Submitted: auto-generated Date: Wed, 29 Apr 2026 16:19:34 +0000 Message-Id: <69f22f96.1ed18.4502c77b@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9b8eb70ca974c2c700f228adaceb9a6b9e918d00 commit 9b8eb70ca974c2c700f228adaceb9a6b9e918d00 Author: Gleb Smirnoff AuthorDate: 2026-04-29 16:19:03 +0000 Commit: Gleb Smirnoff CommitDate: 2026-04-29 16:19:03 +0000 inpcb: improve some internal function names The 'hash' subword doesn't bring any additional information. All inpcb lookup functions operate on hashes. For lookup functions that work on either exact hash or wild hash just perform s/hash_//. Rename in_pcblookup_hash() into in_pcblookup_with_lock(), emphasizing its difference to in_pcblookup_smr(). Rename in_pcblookup_hash_locked() to in_pcblookup_internal(), as it doesn't return a locked inpcb and is used only for internal purposes. Note that the IPv6 sibling of this function already lives by name in6_pcblookup_internal(). Some future changes will make such naming more justified. No functional change. Reviewed by: pouria, markj Differential Revision: https://reviews.freebsd.org/D56482 --- sys/netinet/in_pcb.c | 53 ++++++++++++++++++++++++++------------------------ sys/netinet6/in6_pcb.c | 46 +++++++++++++++++++++---------------------- sys/netinet6/in6_pcb.h | 2 +- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 3bb742f11c87..2e1a00209cb4 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -134,10 +134,9 @@ VNET_DEFINE(int, ipport_reservedlow); VNET_DEFINE(int, ipport_randomized) = 1; #ifdef INET -static struct inpcb *in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, - struct in_addr faddr, u_int fport_arg, - struct in_addr laddr, u_int lport_arg, - int lookupflags, uint8_t numa_domain, int fib); +static struct inpcb *in_pcblookup_internal(struct inpcbinfo *pcbinfo, + struct in_addr faddr, u_int fport_arg, struct in_addr laddr, + u_int lport_arg, int lookupflags, uint8_t numa_domain, int fib); #define RANGECHK(var, min, max) \ if ((var) < (min)) { (var) = (min); } \ @@ -809,14 +808,14 @@ in_pcb_lport_dest(const struct inpcb *inp, struct sockaddr *lsa, if (fsa != NULL) { #ifdef INET if (lsa->sa_family == AF_INET) { - tmpinp = in_pcblookup_hash_locked(pcbinfo, + tmpinp = in_pcblookup_internal(pcbinfo, faddr, fport, laddr, lport, lookupflags, M_NODOM, RT_ALL_FIBS); } #endif #ifdef INET6 if (lsa->sa_family == AF_INET6) { - tmpinp = in6_pcblookup_hash_locked(pcbinfo, + tmpinp = in6_pcblookup_internal(pcbinfo, faddr6, fport, laddr6, lport, lookupflags, M_NODOM, RT_ALL_FIBS); } @@ -1171,7 +1170,7 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) INP_HASH_WUNLOCK(inp->inp_pcbinfo); return (error); } - } else if (in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, + } else if (in_pcblookup_internal(inp->inp_pcbinfo, faddr, sin->sin_port, laddr, inp->inp_lport, 0, M_NODOM, RT_ALL_FIBS) != NULL) { INP_HASH_WUNLOCK(inp->inp_pcbinfo); @@ -2242,7 +2241,7 @@ in_pcblookup_exact_match(const struct inpcb *inp, struct in_addr faddr, } static struct inpcb * -in_pcblookup_hash_exact(struct inpcbinfo *pcbinfo, struct in_addr faddr, +in_pcblookup_exact(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_short fport, struct in_addr laddr, u_short lport) { struct inpcbhead *head; @@ -2288,7 +2287,7 @@ in_pcblookup_wild_match(const struct inpcb *inp, struct in_addr laddr, #define INP_LOOKUP_AGAIN ((struct inpcb *)(uintptr_t)-1) static struct inpcb * -in_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, struct in_addr laddr, +in_pcblookup_wild_smr(struct inpcbinfo *pcbinfo, struct in_addr laddr, u_short lport, int fib, const inp_lookup_t lockflags) { struct inpcbhead *head; @@ -2325,7 +2324,7 @@ in_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, struct in_addr laddr, } static struct inpcb * -in_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, struct in_addr laddr, +in_pcblookup_wild_locked(struct inpcbinfo *pcbinfo, struct in_addr laddr, u_short lport, int fib) { struct inpcbhead *head; @@ -2404,7 +2403,7 @@ in_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, struct in_addr laddr, * out incoming packets. */ static struct inpcb * -in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr, +in_pcblookup_internal(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport_arg, struct in_addr laddr, u_int lport_arg, int lookupflags, uint8_t numa_domain, int fib) { @@ -2419,7 +2418,7 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr, ("%s: invalid local address", __func__)); INP_HASH_WLOCK_ASSERT(pcbinfo); - inp = in_pcblookup_hash_exact(pcbinfo, faddr, fport, laddr, lport); + inp = in_pcblookup_exact(pcbinfo, faddr, fport, laddr, lport); if (inp != NULL) return (inp); @@ -2427,7 +2426,7 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr, inp = in_pcblookup_lbgroup(pcbinfo, &faddr, fport, &laddr, lport, numa_domain, fib); if (inp == NULL) { - inp = in_pcblookup_hash_wild_locked(pcbinfo, laddr, + inp = in_pcblookup_wild_locked(pcbinfo, laddr, lport, fib); } } @@ -2435,8 +2434,12 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr, return (inp); } +/* + * Lookup inpcb using locks. Used by in_pcblookup_smr() in case inp_smr_lock() + * failed. + */ static struct inpcb * -in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, +in_pcblookup_with_lock(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, struct in_addr laddr, u_int lport, int lookupflags, uint8_t numa_domain, int fib) { @@ -2447,7 +2450,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, ("%s: LOCKPCB not set", __func__)); INP_HASH_WLOCK(pcbinfo); - inp = in_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport, + inp = in_pcblookup_internal(pcbinfo, faddr, fport, laddr, lport, lookupflags & ~INPLOOKUP_LOCKMASK, numa_domain, fib); if (inp != NULL && !inp_trylock(inp, lockflags)) { in_pcbref(inp); @@ -2463,7 +2466,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, } static struct inpcb * -in_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, +in_pcblookup_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport_arg, struct in_addr laddr, u_int lport_arg, int lookupflags, uint8_t numa_domain, int fib) { @@ -2477,7 +2480,7 @@ in_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, ("%s: LOCKPCB not set", __func__)); smr_enter(pcbinfo->ipi_smr); - inp = in_pcblookup_hash_exact(pcbinfo, faddr, fport, laddr, lport); + inp = in_pcblookup_exact(pcbinfo, faddr, fport, laddr, lport); if (inp != NULL) { if (__predict_true(inp_smr_lock(inp, lockflags))) { /* @@ -2494,8 +2497,8 @@ in_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, * We failed to lock the inpcb, or its connection state changed * out from under us. Fall back to a precise search. */ - return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, - lookupflags, numa_domain, fib)); + return (in_pcblookup_with_lock(pcbinfo, faddr, fport, laddr, + lport, lookupflags, numa_domain, fib)); } if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { @@ -2510,12 +2513,12 @@ in_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, } inp = INP_LOOKUP_AGAIN; } else { - inp = in_pcblookup_hash_wild_smr(pcbinfo, laddr, lport, + inp = in_pcblookup_wild_smr(pcbinfo, laddr, lport, fib, lockflags); } if (inp == INP_LOOKUP_AGAIN) { - return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, - lport, lookupflags, numa_domain, fib)); + return (in_pcblookup_with_lock(pcbinfo, faddr, fport, + laddr, lport, lookupflags, numa_domain, fib)); } } @@ -2537,7 +2540,7 @@ in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, int fib; fib = (lookupflags & INPLOOKUP_FIB) ? if_getfib(ifp) : RT_ALL_FIBS; - return (in_pcblookup_hash_smr(pcbinfo, faddr, fport, laddr, lport, + return (in_pcblookup_smr(pcbinfo, faddr, fport, laddr, lport, lookupflags, M_NODOM, fib)); } @@ -2550,7 +2553,7 @@ in_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in_addr faddr, M_ASSERTPKTHDR(m); fib = (lookupflags & INPLOOKUP_FIB) ? M_GETFIB(m) : RT_ALL_FIBS; - return (in_pcblookup_hash_smr(pcbinfo, faddr, fport, laddr, lport, + return (in_pcblookup_smr(pcbinfo, faddr, fport, laddr, lport, lookupflags, m->m_pkthdr.numa_domain, fib)); } #endif /* INET */ @@ -2563,7 +2566,7 @@ in_pcbjailed(const struct inpcb *inp, unsigned int flag) /* * Insert the PCB into a hash chain using ordering rules which ensure that - * in_pcblookup_hash_wild_*() always encounter the highest-ranking PCB first. + * in_pcblookup_wild_*() always encounter the highest-ranking PCB first. * * Specifically, keep jailed PCBs in front of non-jailed PCBs, and keep PCBs * with exact local addresses ahead of wildcard PCBs. Unbound v4-mapped v6 PCBs diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index bbb7414a206d..8132899bb0d9 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -485,8 +485,8 @@ in6_pcbconnect(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred, return (error); } - if (in6_pcblookup_hash_locked(pcbinfo, &sin6->sin6_addr, - sin6->sin6_port, IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) ? + if (in6_pcblookup_internal(pcbinfo, &sin6->sin6_addr, sin6->sin6_port, + IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) ? &laddr6.sin6_addr : &inp->in6p_laddr, inp->inp_lport, 0, M_NODOM, RT_ALL_FIBS) != NULL) { INP_HASH_WUNLOCK(pcbinfo); @@ -992,9 +992,8 @@ in6_pcblookup_exact_match(const struct inpcb *inp, const struct in6_addr *faddr, } static struct inpcb * -in6_pcblookup_hash_exact(struct inpcbinfo *pcbinfo, - const struct in6_addr *faddr, u_short fport, - const struct in6_addr *laddr, u_short lport) +in6_pcblookup_exact(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, + u_short fport, const struct in6_addr *laddr, u_short lport) { struct inpcbhead *head; struct inpcb *inp; @@ -1041,7 +1040,7 @@ in6_pcblookup_wild_match(const struct inpcb *inp, const struct in6_addr *laddr, #define INP_LOOKUP_AGAIN ((struct inpcb *)(uintptr_t)-1) static struct inpcb * -in6_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, +in6_pcblookup_wild_smr(struct inpcbinfo *pcbinfo, const struct in6_addr *laddr, u_short lport, int fib, const inp_lookup_t lockflags) { @@ -1080,7 +1079,7 @@ in6_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, } static struct inpcb * -in6_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, +in6_pcblookup_wild_locked(struct inpcbinfo *pcbinfo, const struct in6_addr *laddr, u_short lport, int fib) { struct inpcbhead *head; @@ -1139,9 +1138,8 @@ in6_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, } struct inpcb * -in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, - const struct in6_addr *faddr, u_int fport_arg, - const struct in6_addr *laddr, u_int lport_arg, +in6_pcblookup_internal(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, + u_int fport_arg, const struct in6_addr *laddr, u_int lport_arg, int lookupflags, uint8_t numa_domain, int fib) { struct inpcb *inp; @@ -1155,7 +1153,7 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, ("%s: invalid local address", __func__)); INP_HASH_LOCK_ASSERT(pcbinfo); - inp = in6_pcblookup_hash_exact(pcbinfo, faddr, fport, laddr, lport); + inp = in6_pcblookup_exact(pcbinfo, faddr, fport, laddr, lport); if (inp != NULL) return (inp); @@ -1163,15 +1161,15 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, inp = in6_pcblookup_lbgroup(pcbinfo, faddr, fport, laddr, lport, numa_domain, fib); if (inp == NULL) { - inp = in6_pcblookup_hash_wild_locked(pcbinfo, - laddr, lport, fib); + inp = in6_pcblookup_wild_locked(pcbinfo, laddr, lport, + fib); } } return (inp); } static struct inpcb * -in6_pcblookup_hash(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, +in6_pcblookup_with_lock(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, u_int fport, const struct in6_addr *laddr, u_int lport, int lookupflags, uint8_t numa_domain, int fib) { @@ -1182,7 +1180,7 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, ("%s: LOCKPCB not set", __func__)); INP_HASH_WLOCK(pcbinfo); - inp = in6_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport, + inp = in6_pcblookup_internal(pcbinfo, faddr, fport, laddr, lport, lookupflags & ~INPLOOKUP_LOCKMASK, numa_domain, fib); if (inp != NULL && !inp_trylock(inp, lockflags)) { in_pcbref(inp); @@ -1198,7 +1196,7 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, } static struct inpcb * -in6_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, +in6_pcblookup_smr(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, u_int fport_arg, const struct in6_addr *laddr, u_int lport_arg, int lookupflags, uint8_t numa_domain, int fib) { @@ -1212,7 +1210,7 @@ in6_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, ("%s: LOCKPCB not set", __func__)); smr_enter(pcbinfo->ipi_smr); - inp = in6_pcblookup_hash_exact(pcbinfo, faddr, fport, laddr, lport); + inp = in6_pcblookup_exact(pcbinfo, faddr, fport, laddr, lport); if (inp != NULL) { if (__predict_true(inp_smr_lock(inp, lockflags))) { if (__predict_true(in6_pcblookup_exact_match(inp, @@ -1224,8 +1222,8 @@ in6_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, * We failed to lock the inpcb, or its connection state changed * out from under us. Fall back to a precise search. */ - return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, - lookupflags, numa_domain, fib)); + return (in6_pcblookup_with_lock(pcbinfo, faddr, fport, laddr, + lport, lookupflags, numa_domain, fib)); } if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { @@ -1240,12 +1238,12 @@ in6_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, } inp = INP_LOOKUP_AGAIN; } else { - inp = in6_pcblookup_hash_wild_smr(pcbinfo, laddr, lport, + inp = in6_pcblookup_wild_smr(pcbinfo, laddr, lport, fib, lockflags); } if (inp == INP_LOOKUP_AGAIN) { - return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, - lport, lookupflags, numa_domain, fib)); + return (in6_pcblookup_with_lock(pcbinfo, faddr, fport, + laddr, lport, lookupflags, numa_domain, fib)); } } @@ -1267,7 +1265,7 @@ in6_pcblookup(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, int fib; fib = (lookupflags & INPLOOKUP_FIB) ? if_getfib(ifp) : RT_ALL_FIBS; - return (in6_pcblookup_hash_smr(pcbinfo, faddr, fport, laddr, lport, + return (in6_pcblookup_smr(pcbinfo, faddr, fport, laddr, lport, lookupflags, M_NODOM, fib)); } @@ -1280,7 +1278,7 @@ in6_pcblookup_mbuf(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, M_ASSERTPKTHDR(m); fib = (lookupflags & INPLOOKUP_FIB) ? M_GETFIB(m) : RT_ALL_FIBS; - return (in6_pcblookup_hash_smr(pcbinfo, faddr, fport, laddr, lport, + return (in6_pcblookup_smr(pcbinfo, faddr, fport, laddr, lport, lookupflags, m->m_pkthdr.numa_domain, fib)); } diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h index da29b1d2e065..aafc1cda8ca6 100644 --- a/sys/netinet6/in6_pcb.h +++ b/sys/netinet6/in6_pcb.h @@ -76,7 +76,7 @@ int in6_pcbconnect(struct inpcb *, struct sockaddr_in6 *, struct ucred *, void in6_pcbdisconnect(struct inpcb *); struct inpcb *in6_pcblookup_local(struct inpcbinfo *, const struct in6_addr *, u_short, int, int, struct ucred *); -struct inpcb *in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, +struct inpcb *in6_pcblookup_internal(struct inpcbinfo *pcbinfo, const struct in6_addr *faddr, u_int fport_arg, const struct in6_addr *laddr, u_int lport_arg, int lookupflags, uint8_t numa_domain, int fib);