From owner-svn-src-stable@FreeBSD.ORG Tue Mar 17 10:15:49 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9528C106566C; Tue, 17 Mar 2009 10:15:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81FDE8FC13; Tue, 17 Mar 2009 10:15:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HAFnLf092045; Tue, 17 Mar 2009 10:15:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HAFnDa092044; Tue, 17 Mar 2009 10:15:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903171015.n2HAFnDa092044@svn.freebsd.org> From: Robert Watson Date: Tue, 17 Mar 2009 10:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189920 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2009 10:15:50 -0000 Author: rwatson Date: Tue Mar 17 10:15:49 2009 New Revision: 189920 URL: http://svn.freebsd.org/changeset/base/189920 Log: Merge r188992 from head to stable/7: In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL checks for the tcpcb, previously used to detect complete disconnection, with INP_DROPPED checks. Correct that, preventing shutdown() from improperly generating a TCP segment with destination IP and port of 0.0.0.0:0. PR: kern/132050 Reported by: david gueluy Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_usrreq.c Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Tue Mar 17 09:50:40 2009 (r189919) +++ stable/7/sys/netinet/tcp_usrreq.c Tue Mar 17 10:15:49 2009 (r189920) @@ -712,7 +712,8 @@ tcp_usr_shutdown(struct socket *so) TCPDEBUG1(); socantsendmore(so); tcp_usrclosed(tp); - error = tcp_output_disconnect(tp); + if (!(inp->inp_vflag & INP_DROPPED)) + error = tcp_output_disconnect(tp); out: TCPDEBUG2(PRU_SHUTDOWN); @@ -844,7 +845,7 @@ tcp_usr_send(struct socket *so, int flag INP_INFO_WUNLOCK(&tcbinfo); headlocked = 0; } - if (tp != NULL) { + if (!(inp->inp_vflag & INP_DROPPED)) { if (flags & PRUS_MORETOCOME) tp->t_flags |= TF_MORETOCOME; error = tcp_output_send(tp);