diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1113,8 +1113,10 @@ goto failed; } bzero(&scs, sizeof(scs)); - if (syncookie_expand(inc, sch, &scs, th, to, *lsop, port)) + if (syncookie_expand(inc, sch, &scs, th, to, *lsop, port)) { sc = &scs; + TCPSTAT_INC(tcps_sc_recvcookie); + } if (locked) SCH_UNLOCK(sch); if (sc == NULL) { @@ -2344,7 +2346,6 @@ sc->sc_port = port; - TCPSTAT_INC(tcps_sc_recvcookie); return (true); }