Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2012 09:47:22 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r234948 - stable/9/contrib/traceroute
Message-ID:  <201205030947.q439lML1030808@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Thu May  3 09:47:22 2012
New Revision: 234948
URL: http://svn.freebsd.org/changeset/base/234948

Log:
  MFC r234701:
  
  Fix a bug in the TCP tracerouting which resulted in not accepting any
  incoming packets. So all packets seemed to be lost.

Modified:
  stable/9/contrib/traceroute/traceroute.c
Directory Properties:
  stable/9/contrib/traceroute/   (props changed)

Modified: stable/9/contrib/traceroute/traceroute.c
==============================================================================
--- stable/9/contrib/traceroute/traceroute.c	Thu May  3 09:17:31 2012	(r234947)
+++ stable/9/contrib/traceroute/traceroute.c	Thu May  3 09:47:22 2012	(r234948)
@@ -1406,8 +1406,7 @@ tcp_prep(struct outdata *outdata)
 
 	tcp->th_sport = htons(ident);
 	tcp->th_dport = htons(port + (fixedPort ? 0 : outdata->seq));
-	tcp->th_seq = (tcp->th_sport << 16) | (tcp->th_dport +
-	    (fixedPort ? outdata->seq : 0));
+	tcp->th_seq = (tcp->th_sport << 16) | tcp->th_dport;
 	tcp->th_ack = 0;
 	tcp->th_off = 5;
 	tcp->th_flags = TH_SYN;
@@ -1425,8 +1424,8 @@ tcp_check(const u_char *data, int seq)
 	struct tcphdr *const tcp = (struct tcphdr *) data;
 
 	return (ntohs(tcp->th_sport) == ident
-	    && ntohs(tcp->th_dport) == port + (fixedPort ? 0 : seq))
-	    && tcp->th_seq == (((tcp_seq)ident << 16) | (port + seq));
+	    && ntohs(tcp->th_dport) == port + (fixedPort ? 0 : seq)
+	    && tcp->th_seq == (tcp_seq)((tcp->th_sport << 16) | tcp->th_dport));
 }
 
 void



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