tcptraceroute patch

Jeremy Utley jeremy at linuxfromscratch.org
Wed Oct 29 18:12:20 PST 2003


Tushar, et al:

Attached is a patch in proper format for the program tcptraceroute.  It has
a minor syntax error when compiled with GCC 3.3.x, and no patch has yet been
submitted for it.  I was able to pull this patch out of the Gentoo Ebuilds
for it, and it works perfectly.

Thanks!

-J-
-------------- next part --------------
Submitted By: Jeremy Utley <jeremy at linuxfromscratch.org>
Date: 2003-10-29
Origin: Gentoo tcptraceroute Ebuild
Description: Fixes syntax errors with GCC 3.3.x in tcptraceroute.c

diff -Naur tcptraceroute-1.4-old/tcptraceroute.c tcptraceroute-1.4/tcptraceroute.c
--- tcptraceroute-1.4-old/tcptraceroute.c	2002-07-30 21:51:27.000000000 +0000
+++ tcptraceroute-1.4/tcptraceroute.c	2003-10-30 02:05:11.000000000 +0000
@@ -391,10 +391,10 @@
 void usage(void)
 {
 	printf("\n%s\n%s\n", VERSION, BANNER);
-    fatal("Usage: %s [-nNFSAE] [-i <interface>] [-f <first ttl>]
-       [-l <packet length>] [-q <number of queries>] [-t <tos>]
-       [-m <max ttl>] [-pP] <source port>] [-s <source address>]
-       [-w <wait time>] <host> [destination port] [packet length]\n\n", name);
+    fatal("Usage: %s [-nNFSAE] [-i <interface>] [-f <first ttl>]\n"\
+"       [-l <packet length>] [-q <number of queries>] [-t <tos>]\n"\
+"       [-m <max ttl>] [-pP] <source port>] [-s <source address>]\n"\
+"       [-w <wait time>] <host> [destination port] [packet length]\n\n", name);
 }
 
 void about(void)
@@ -1182,9 +1182,9 @@
 	if (! (pcap = pcap_open_live(device, offset + SNAPLEN, 0, 10, errbuf)))
 		fatal("pcap_open_live failed: %s", errbuf);
 
-	safe_snprintf(filter, TEXTSIZE, "
-		(tcp and src host %s and src port %d and dst host %s)
-		or ((icmp[0] == 11 or icmp[0] == 3) and dst host %s)",
+	safe_snprintf(filter, TEXTSIZE, \
+"		(tcp and src host %s and src port %d and dst host %s)\n"\
+"		or ((icmp[0] == 11 or icmp[0] == 3) and dst host %s)",
 			iptos(dst_ip), dst_prt, iptos(src_ip), iptos(src_ip));
 
 	if (o_nofilter)
@@ -2003,6 +2003,6 @@
 
 	defaults();
 	initcapture();
-	seteuid(getuid());
+	setuid(getuid());
 	return trace();
 }


More information about the patches mailing list