git: 14a47a8bed87 - main - inpcb: remove always true condition in in_pcblookup_local()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 21 Apr 2026 16:11:11 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=14a47a8bed8758abd7ea6ced14e8a8d9bd2c97bc
commit 14a47a8bed8758abd7ea6ced14e8a8d9bd2c97bc
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-04-21 16:10:49 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-04-21 16:10:49 +0000
inpcb: remove always true condition in in_pcblookup_local()
We are searching through the hash that has only wildcard bindings.
This was missed by fdb987bebddf05e15a5af840379c7715a94aec1c.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56488
---
sys/netinet/in_pcb.c | 3 +--
sys/netinet6/in6_pcb.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 22c3287b93fd..3bb742f11c87 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -2058,8 +2058,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr,
if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
#endif
- if (inp->inp_faddr.s_addr == INADDR_ANY &&
- inp->inp_laddr.s_addr == laddr.s_addr &&
+ if (inp->inp_laddr.s_addr == laddr.s_addr &&
inp->inp_lport == lport && (fib == RT_ALL_FIBS ||
inp->inp_inc.inc_fibnum == fib)) {
/*
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 3750c7040fbc..bbb7414a206d 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -753,8 +753,7 @@ in6_pcblookup_local(struct inpcbinfo *pcbinfo, const struct in6_addr *laddr,
/* XXX inp locking */
if ((inp->inp_vflag & INP_IPV6) == 0)
continue;
- if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) &&
- IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
+ if (IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
inp->inp_lport == lport && (fib == RT_ALL_FIBS ||
inp->inp_inc.inc_fibnum == fib)) {
/* Found. */