diff options
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r-- | sys/netinet/tcp_syncache.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index a824316..f54c6c9 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -670,7 +670,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) #endif inp = sotoinpcb(so); - INP_LOCK(inp); + INP_WLOCK(inp); /* Insert new socket into PCB hash list. */ inp->inp_inc.inc_isipv6 = sc->sc_inc.inc_isipv6; @@ -817,13 +817,13 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) tp->snd_cwnd = tp->t_maxseg; tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); - INP_UNLOCK(inp); + INP_WUNLOCK(inp); tcpstat.tcps_accepts++; return (so); abort: - INP_UNLOCK(inp); + INP_WUNLOCK(inp); abort2: if (so != NULL) soabort(so); @@ -987,7 +987,7 @@ _syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct syncache scs; INP_INFO_WLOCK_ASSERT(&tcbinfo); - INP_LOCK_ASSERT(inp); /* listen socket */ + INP_WLOCK_ASSERT(inp); /* listen socket */ KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN, ("%s: unexpected tcp flags", __func__)); @@ -1014,13 +1014,13 @@ _syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, #ifdef MAC if (mac_syncache_init(&maclabel) != 0) { - INP_UNLOCK(inp); + INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&tcbinfo); goto done; } else mac_syncache_create(maclabel, inp); #endif - INP_UNLOCK(inp); + INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&tcbinfo); /* |