From owner-p4-projects@FreeBSD.ORG Thu Jul 23 15:16:15 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8EE251065670; Thu, 23 Jul 2009 15:16:15 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB4D106564A for ; Thu, 23 Jul 2009 15:16:15 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3CAF58FC1E for ; Thu, 23 Jul 2009 15:16:15 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NFGF3N036181 for ; Thu, 23 Jul 2009 15:16:15 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6NFGFEX036179 for perforce@freebsd.org; Thu, 23 Jul 2009 15:16:15 GMT (envelope-from andre@freebsd.org) Date: Thu, 23 Jul 2009 15:16:15 GMT Message-Id: <200907231516.n6NFGFEX036179@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 166454 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 15:16:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=166454 Change 166454 by andre@andre_t61 on 2009/07/23 15:15:37 Move the delayed header drop into the socket append block. It is no longer necessary for tcp_reass. Update comment on tcp_reass invocation. Replace thflags with what tcp_reass returns. Or'ing was incorrect. With INVARIANTS zero out th, m and tlen after socket append or tcp_reass. They're no longer valid. Affected files ... .. //depot/projects/tcp_reass/netinet/tcp_input.c#14 edit Differences ... ==== //depot/projects/tcp_reass/netinet/tcp_input.c#14 (text+ko) ==== @@ -2556,7 +2556,6 @@ */ if ((tlen || (thflags & TH_FIN)) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { - m_adj(m, drop_hdrlen); /* delayed header drop */ /* * Insert segment which includes th into TCP reassembly queue * with control block tp. Set thflags to whether reassembly now @@ -2572,6 +2571,7 @@ if (th->th_seq == tp->rcv_nxt && RB_EMPTY(&tp->rcv_reass) && TCPS_HAVEESTABLISHED(tp->t_state)) { + m_adj(m, drop_hdrlen); /* delayed header drop */ if (DELAY_ACK(tp)) tp->t_flags |= TF_DELACK; else @@ -2590,14 +2590,16 @@ sorwakeup_locked(so); } else { /* - * XXX: Due to the header drop above "th" is - * theoretically invalid by now. Fortunately - * m_adj() doesn't actually frees any mbufs - * when trimming from the head. + * NB: tcp_reass() always consumes the mbuf chain. */ - thflags |= tcp_reass(tp, th, &tlen, m); + thflags = tcp_reass(tp, th, &tlen, m); tp->t_flags |= TF_ACKNOW; } +#ifdef INVARIANTS + th = NULL; + m = NULL; + tlen = 0; +#endif /* INVARIANTS */ #if 0 /* * Note the amount of data that peer has sent into