Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Feb 2009 11:17:50 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188992 - head/sys/netinet
Message-ID:  <200902241117.n1OBHoqU063906@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Tue Feb 24 11:17:50 2009
New Revision: 188992
URL: http://svn.freebsd.org/changeset/base/188992

Log:
  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 <david.gueluy at netasq.com>
  MFC after:	3 weeks

Modified:
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_usrreq.c
==============================================================================
--- head/sys/netinet/tcp_usrreq.c	Tue Feb 24 10:48:15 2009	(r188991)
+++ head/sys/netinet/tcp_usrreq.c	Tue Feb 24 11:17:50 2009	(r188992)
@@ -695,7 +695,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);
@@ -828,7 +829,7 @@ tcp_usr_send(struct socket *so, int flag
 			INP_INFO_WUNLOCK(&V_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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902241117.n1OBHoqU063906>