From: Sepherosa Ziehau Date: Sun, 16 Mar 2014 07:31:32 +0000 (+0800) Subject: inpcb: in_pcblookup_local() must have been protected by port token X-Git-Tag: v3.9.0~308 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/6cbb9601427a69f468b70683159fde662d450144 inpcb: in_pcblookup_local() must have been protected by port token --- diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 20f948d251..1bd6076807 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1167,11 +1167,11 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, struct inpcb *match = NULL; /* - * If the porthashbase is shared across several cpus we need - * to lock. + * If the porthashbase is shared across several cpus, it must + * have been locked. */ if (pcbinfo->porttoken) - lwkt_gettoken(pcbinfo->porttoken); + ASSERT_LWKT_TOKEN_HELD(pcbinfo->porttoken); /* * Best fit PCB lookup. @@ -1221,8 +1221,6 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, } } } - if (pcbinfo->porttoken) - lwkt_reltoken(pcbinfo->porttoken); return (match); }