diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-23 08:22:44 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-25 08:38:45 +0200 |
commit | b3169c2a6a01cc0555181f61b5254dd2c1f1c310 (patch) | |
tree | f84d67c9d17b2625481513fa6dc85929fdb08442 /freebsd/sys/netinet6/in6_pcb.c | |
parent | Update rtems_waf (diff) | |
download | rtems-libbsd-b3169c2a6a01cc0555181f61b5254dd2c1f1c310.tar.bz2 |
Update to FreeBSD head 2018-10-23
Git mirror commit 59f44d20be3f99d181ca742e636d45fc39ec982b.
This commit updates OpenSSL to version 1.1.1. This required an update
of racoon which uses some internal stuff from OpenSSL and seems to be
mostly unmaintained, e.g. there is update in the FreeBSD ports to cope
with OpenSSL 1.1.1.
Update #3472.
Diffstat (limited to 'freebsd/sys/netinet6/in6_pcb.c')
-rw-r--r-- | freebsd/sys/netinet6/in6_pcb.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/freebsd/sys/netinet6/in6_pcb.c b/freebsd/sys/netinet6/in6_pcb.c index a30cb98b..53102764 100644 --- a/freebsd/sys/netinet6/in6_pcb.c +++ b/freebsd/sys/netinet6/in6_pcb.c @@ -823,6 +823,10 @@ in6_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp) INP_INFO_WLOCK(pcbinfo); CK_LIST_FOREACH(in6p, pcbinfo->ipi_listhead, inp_list) { INP_WLOCK(in6p); + if (__predict_false(in6p->inp_flags2 & INP_FREED)) { + INP_WUNLOCK(in6p); + continue; + } im6o = in6p->in6p_moptions; if ((in6p->inp_vflag & INP_IPV6) && im6o != NULL) { /* @@ -883,10 +887,9 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr, uint16_t fport, int lookupflags) { - struct inpcb *local_wild = NULL; + struct inpcb *local_wild; const struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; - struct inpcblbgroup *grp_local_wild; uint32_t idx; INP_HASH_LOCK_ASSERT(pcbinfo); @@ -903,33 +906,24 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, * - Load balanced group does not contain jailed sockets. * - Load balanced does not contain IPv4 mapped INET6 wild sockets. */ + local_wild = NULL; CK_LIST_FOREACH(grp, hdr, il_list) { #ifdef INET if (!(grp->il_vflag & INP_IPV6)) continue; #endif - if (grp->il_lport == lport) { - idx = 0; - int pkt_hash = INP_PCBLBGROUP_PKTHASH( - INP6_PCBHASHKEY(faddr), lport, fport); - - idx = pkt_hash % grp->il_inpcnt; + if (grp->il_lport != lport) + continue; - if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) { - return (grp->il_inp[idx]); - } else { - if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && - (lookupflags & INPLOOKUP_WILDCARD)) { - local_wild = grp->il_inp[idx]; - grp_local_wild = grp; - } - } - } + idx = INP_PCBLBGROUP_PKTHASH(INP6_PCBHASHKEY(faddr), lport, + fport) % grp->il_inpcnt; + if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) + return (grp->il_inp[idx]); + if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && + (lookupflags & INPLOOKUP_WILDCARD) != 0) + local_wild = grp->il_inp[idx]; } - if (local_wild != NULL) { - return (local_wild); - } - return (NULL); + return (local_wild); } #ifdef PCBGROUP |