]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/tcp_input.c
xnu-1504.9.26.tar.gz
[apple/xnu.git] / bsd / netinet / tcp_input.c
index e7fda107f4a0ff73bc50891ea0ae101146184f46..b65e9d5c6d2373aa9151e10552196436d8b1e7d5 100644 (file)
@@ -1007,6 +1007,10 @@ findpcb:
                goto drop;
 #endif
 
+       /* Radar 7377561: Avoid processing packets while closing a listen socket */
+       if (tp->t_state == TCPS_LISTEN && (so->so_options & SO_ACCEPTCONN) == 0) 
+               goto drop;
+
        if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) {
 #if TCPDEBUG
                if (so->so_options & SO_DEBUG) {
@@ -1296,7 +1300,6 @@ findpcb:
                        KERNEL_DEBUG(DBG_FNC_TCP_NEWCONN | DBG_FUNC_END,0,0,0,0,0);
                }
        }
-
 #if 1
        lck_mtx_assert(((struct inpcb *)so->so_pcb)->inpcb_mtx, LCK_MTX_ASSERT_OWNED);
 #endif
@@ -1369,7 +1372,7 @@ findpcb:
        }
        
 #if TRAFFIC_MGT
-       if (so->so_traffic_mgt_flags & TRAFFIC_MGT_SO_BACKGROUND) {
+       if (so->so_traffic_mgt_flags & TRAFFIC_MGT_SO_BG_REGULATE) {
                tcpstat.tcps_bg_rcvtotal++;
 
                 /* Take snapshots of pkts recv;