diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2026-04-21 16:10:49 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2026-04-21 16:10:49 +0000 |
| commit | 14a47a8bed8758abd7ea6ced14e8a8d9bd2c97bc (patch) | |
| tree | b640fd8d9ff1ba6336b963fe16cb223e93bd6e4f | |
| parent | ca87c0b8e396fff01d55f1985c2556934c35a950 (diff) | |
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
| -rw-r--r-- | sys/netinet/in_pcb.c | 3 | ||||
| -rw-r--r-- | 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. */ |
