svn commit: r190556 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet

Robert Watson rwatson at FreeBSD.org
Mon Mar 30 07:11:39 PDT 2009


Author: rwatson
Date: Mon Mar 30 14:11:37 2009
New Revision: 190556
URL: http://svn.freebsd.org/changeset/base/190556

Log:
  Merge r189196 from head to stable/7:
  
    Remove unreachable code for generating RST segments from tcp_twcheck();
    this code became stale when T/TCP support was removed.
  
    Discussed with: bz, sam
  
  Approved by:	re (kensmith)

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_timewait.c

Modified: stable/7/sys/netinet/tcp_timewait.c
==============================================================================
--- stable/7/sys/netinet/tcp_timewait.c	Mon Mar 30 12:26:19 2009	(r190555)
+++ stable/7/sys/netinet/tcp_timewait.c	Mon Mar 30 14:11:37 2009	(r190556)
@@ -320,11 +320,6 @@ tcp_twcheck(struct inpcb *inp, struct tc
 	struct tcptw *tw;
 	int thflags;
 	tcp_seq seq;
-#ifdef INET6
-	int isipv6 = (mtod(m, struct ip *)->ip_v == 6) ? 1 : 0;
-#else
-	const int isipv6 = 0;
-#endif
 
 	/* tcbinfo lock required for tcp_twclose(), tcp_tw_2msl_reset(). */
 	INP_INFO_WLOCK_ASSERT(&tcbinfo);
@@ -404,46 +399,6 @@ tcp_twcheck(struct inpcb *inp, struct tc
 	if (thflags != TH_ACK || tlen != 0 ||
 	    th->th_seq != tw->rcv_nxt || th->th_ack != tw->snd_nxt)
 		tcp_twrespond(tw, TH_ACK);
-	goto drop;
-
-	/*
-	 * Generate a RST, dropping incoming segment.
-	 * Make ACK acceptable to originator of segment.
-	 * Don't bother to respond if destination was broadcast/multicast.
-	 */
-	if (m->m_flags & (M_BCAST|M_MCAST))
-		goto drop;
-	if (isipv6) {
-#ifdef INET6
-		struct ip6_hdr *ip6;
-
-		/* IPv6 anycast check is done at tcp6_input() */
-		ip6 = mtod(m, struct ip6_hdr *);
-		if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) ||
-		    IN6_IS_ADDR_MULTICAST(&ip6->ip6_src))
-			goto drop;
-#endif
-	} else {
-		struct ip *ip;
-
-		ip = mtod(m, struct ip *);
-		if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
-		    IN_MULTICAST(ntohl(ip->ip_src.s_addr)) ||
-		    ip->ip_src.s_addr == htonl(INADDR_BROADCAST) ||
-		    in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
-			goto drop;
-	}
-	if (thflags & TH_ACK) {
-		tcp_respond(NULL,
-		    mtod(m, void *), th, m, 0, th->th_ack, TH_RST);
-	} else {
-		seq = th->th_seq + (thflags & TH_SYN ? 1 : 0);
-		tcp_respond(NULL,
-		    mtod(m, void *), th, m, seq, 0, TH_RST|TH_ACK);
-	}
-	INP_WUNLOCK(inp);
-	return (0);
-
 drop:
 	INP_WUNLOCK(inp);
 	m_freem(m);


More information about the svn-src-all mailing list