diff -ru -b -P tcptraceroute-1.5beta4/ChangeLog tcptraceroute-1.5beta5/ChangeLog --- tcptraceroute-1.5beta4/ChangeLog Sun Jun 29 16:22:11 2003 +++ tcptraceroute-1.5beta5/ChangeLog Thu Jul 3 17:30:59 2003 @@ -1,3 +1,22 @@ +Version 1.5beta5 (2003-07-02) + + Now functions properly with libpcap when using an interface without a + valid IPv4 addresss. Reported by Kris Shannon + in Debian Bug#183456. + + Improved autoconf handling of the --with-libpcap= command line argument, + by Richard van den Berg . + + Moved the tcptraceroute man page from section 1 to section 8 now that + tcptraceroute is installed in /usr/bin by default, as suggested by + James Ralston . + + Added a missing call to pcap_freecode() to free up memory utilized + by the bpf_program struct, after applying it with pcap_setfilter(). + + Should now deal better (and skip over) unconfigured interface under + NetBSD. + Version 1.5beta4 (2003-06-29) A call to seteuid() has been replaced with a call to setuid() to fully @@ -5,12 +24,12 @@ portions of tcptraceroute, older versions are still believed to be safe even without fully dropping privileges, however users are still encouraged to upgrade to provide a measure of containment in the event - that an exploitable flaw is discovered in the future. Reported by - David Coe and Matt Zimmerman , - and published in Debian Security Advisory DSA 330-1. + that an exploitable flaw is discovered in the future. Reported by Matt + Zimmerman , and published in Debian Security Advisory + DSA 330-1. AC_FUNC_REALLOC was commented out of configure.ac, which was failing on - IRIX badly systems. The xrealloc() function in tcptraceroute already + HP/UX badly systems. The xrealloc() function in tcptraceroute already works around the realloc(0,0) case that AC_FUNC_REALLOC is attempting to prevent against, anyway. Reported by Petter Reinholdtsen . @@ -38,7 +57,7 @@ jbash@velvet.com Jon Allen Boone - James Ralston + James Ralston Darren Tucker Matt Weidner @@ -51,6 +70,7 @@ Removed a number of multi-line strings, which apparently causes trouble for some compilers, based on patches from: + jbash@velvet.com Richard van den Berg Petter Reinholdtsen diff -ru -b -P tcptraceroute-1.5beta4/Makefile.am tcptraceroute-1.5beta5/Makefile.am --- tcptraceroute-1.5beta4/Makefile.am Sun May 25 02:23:11 2003 +++ tcptraceroute-1.5beta5/Makefile.am Thu Jul 3 00:01:37 2003 @@ -1,10 +1,10 @@ bin_PROGRAMS = tcptraceroute tcptraceroute_SOURCES = tcptraceroute.c -man_MANS = tcptraceroute.8 +man_MANS = tcptraceroute.1 docdir = $(datadir)/doc/tcptraceroute doc_DATA = AUTHORS COPYING ChangeLog NEWS README \ - examples.txt tcptraceroute.8.html tcptraceroute.lsm + examples.txt tcptraceroute.1.html tcptraceroute.lsm EXTRA_DIST = $(doc_DATA) $(man_MANS) VERSION debian diff -ru -b -P tcptraceroute-1.5beta4/Makefile.in tcptraceroute-1.5beta5/Makefile.in --- tcptraceroute-1.5beta4/Makefile.in Sun Jun 29 17:00:36 2003 +++ tcptraceroute-1.5beta5/Makefile.in Thu Jul 3 15:57:00 2003 @@ -73,10 +73,10 @@ bin_PROGRAMS = tcptraceroute tcptraceroute_SOURCES = tcptraceroute.c -man_MANS = tcptraceroute.8 +man_MANS = tcptraceroute.1 docdir = $(datadir)/doc/tcptraceroute -doc_DATA = AUTHORS COPYING ChangeLog NEWS README examples.txt tcptraceroute.8.html tcptraceroute.lsm +doc_DATA = AUTHORS COPYING ChangeLog NEWS README examples.txt tcptraceroute.1.html tcptraceroute.lsm EXTRA_DIST = $(doc_DATA) $(man_MANS) VERSION debian @@ -99,7 +99,7 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -man8dir = $(mandir)/man8 +man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff @@ -211,12 +211,12 @@ @rm -f tcptraceroute $(LINK) $(tcptraceroute_LDFLAGS) $(tcptraceroute_OBJECTS) $(tcptraceroute_LDADD) $(LIBS) -install-man8: - $(mkinstalldirs) $(DESTDIR)$(man8dir) - @list='$(man8_MANS)'; \ +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ - *.8*) list="$$list $$i" ;; \ + *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ @@ -225,30 +225,30 @@ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done -uninstall-man8: - @list='$(man8_MANS)'; \ +uninstall-man1: + @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ - *.8*) list="$$list $$i" ;; \ + *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ - rm -f $(DESTDIR)$(man8dir)/$$inst; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man8 + $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man8 + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @@ -373,7 +373,7 @@ install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man8 \ + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 \ $(DESTDIR)$(docdir) @@ -416,7 +416,7 @@ mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-man8 uninstall-man8 install-man \ +maintainer-clean-compile install-man1 uninstall-man1 install-man \ uninstall-man uninstall-docDATA install-docDATA tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ diff -ru -b -P tcptraceroute-1.5beta4/VERSION tcptraceroute-1.5beta5/VERSION --- tcptraceroute-1.5beta4/VERSION Sun Jun 29 16:10:57 2003 +++ tcptraceroute-1.5beta5/VERSION Wed Jul 2 23:52:16 2003 @@ -1 +1 @@ -1.5beta4 +1.5beta5 diff -ru -b -P tcptraceroute-1.5beta4/config.h.in tcptraceroute-1.5beta5/config.h.in --- tcptraceroute-1.5beta4/config.h.in Sun Jun 29 16:46:41 2003 +++ tcptraceroute-1.5beta5/config.h.in Thu Jul 3 15:39:03 2003 @@ -139,11 +139,11 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Target platform */ +#undef TARGET + /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME - -/* Track IP IDs by default */ -#undef TRACK_ID_DEFAULT /* Track ports by default */ #undef TRACK_PORT_DEFAULT diff -ru -b -P tcptraceroute-1.5beta4/configure tcptraceroute-1.5beta5/configure --- tcptraceroute-1.5beta4/configure Sun Jun 29 16:46:40 2003 +++ tcptraceroute-1.5beta5/configure Thu Jul 3 15:56:36 2003 @@ -3175,6 +3175,8 @@ test -f "$withval/include/pcap.h" && CPPFLAGS="$CPPFLAGS -I$withval/include" test -f "$withval/pcap.a" && LDFLAGS="$LDFLAGS -L$withval" + test -f "$withval/libpcap.a" && LDFLAGS="$LDFLAGS -L$withval" + test -f "$withval/lib/pcap.a" && LDFLAGS="$LDFLAGS -L$withval/lib" test -f "$withval/lib/libpcap.a" && LDFLAGS="$LDFLAGS -L$withval/lib" fi; @@ -4185,7 +4187,7 @@ # AC_FUNC_REALLOC # our tcptraceroute.c:xrealloc() function deals with # the realloc(0,0) case, and AC_FUNC_REALLOC doesn't - # appear to break on IRIX systems. + # appear to break on HP/UX systems. for ac_header in sys/select.h sys/socket.h @@ -4670,7 +4672,6 @@ #AC_SUBST(CPPFLAGS) #AC_SUBST(NO_MINUS_C_MINUS_O) - # Is this Solaris? echo "$as_me:$LINENO: checking for Solaris" >&5 echo $ECHO_N "checking for Solaris... $ECHO_C" >&6 @@ -4864,7 +4865,7 @@ else cat >>confdefs.h <<\_ACEOF -#define TRACK_ID_DEFAULT 1 +#define TRACK_PORT_DEFAULT 0 _ACEOF fi @@ -4912,6 +4913,10 @@ fi; + +cat >>confdefs.h <<_ACEOF +#define TARGET "$target" +_ACEOF ac_config_files="$ac_config_files Makefile" diff -ru -b -P tcptraceroute-1.5beta4/configure.ac tcptraceroute-1.5beta5/configure.ac --- tcptraceroute-1.5beta4/configure.ac Sun Jun 29 16:10:57 2003 +++ tcptraceroute-1.5beta5/configure.ac Thu Jul 3 15:56:30 2003 @@ -3,7 +3,7 @@ # Process this file with autoconf to produce a configure script. # Initialization. -AC_PREREQ(2.57) +AC_PREREQ(2.50) AC_INIT(tcptraceroute) AC_CANONICAL_SYSTEM @@ -32,6 +32,8 @@ test -f "$withval/include/pcap.h" && CPPFLAGS="$CPPFLAGS -I$withval/include" test -f "$withval/pcap.a" && LDFLAGS="$LDFLAGS -L$withval" + test -f "$withval/libpcap.a" && LDFLAGS="$LDFLAGS -L$withval" + test -f "$withval/lib/pcap.a" && LDFLAGS="$LDFLAGS -L$withval/lib" test -f "$withval/lib/libpcap.a" && LDFLAGS="$LDFLAGS -L$withval/lib" ], []) AC_CHECK_LIB(pcap, pcap_open_live, , [AC_MSG_ERROR([cannot find libpcap])]) @@ -100,7 +102,7 @@ AC_FUNC_MALLOC # AC_FUNC_REALLOC # our tcptraceroute.c:xrealloc() function deals with # the realloc(0,0) case, and AC_FUNC_REALLOC doesn't - # appear to break on IRIX systems. + # appear to break on HP/UX systems. AC_FUNC_SELECT_ARGTYPES AC_FUNC_VPRINTF AC_CHECK_FUNCS([gettimeofday memset select socket strchr]) @@ -110,7 +112,6 @@ #AC_SUBST(CPPFLAGS) #AC_SUBST(NO_MINUS_C_MINUS_O) - # Is this Solaris? AC_MSG_CHECKING(for Solaris) AC_RUN_IFELSE([AC_LANG_PROGRAM( [], [ @@ -182,7 +183,7 @@ if test "$TRACK_DEFAULT" = "port"; then AC_DEFINE(TRACK_PORT_DEFAULT, 1, [Track ports by default]) else - AC_DEFINE(TRACK_ID_DEFAULT, 1, [Track IP IDs by default]) + AC_DEFINE(TRACK_PORT_DEFAULT, 0, [Track ports by default]) fi # Handle --enable-default-port=N @@ -214,6 +215,6 @@ fi ], []) - +AC_DEFINE_UNQUOTED(TARGET, "$target", [Target platform]) AC_CONFIG_FILES(Makefile) AC_OUTPUT diff -ru -b -P tcptraceroute-1.5beta4/debian/docs tcptraceroute-1.5beta5/debian/docs --- tcptraceroute-1.5beta4/debian/docs Sun Jul 1 21:20:22 2001 +++ tcptraceroute-1.5beta5/debian/docs Thu Jul 3 00:01:46 2003 @@ -1,4 +1,4 @@ README tcptraceroute.lsm -tcptraceroute.8.html +tcptraceroute.1.html examples.txt diff -ru -b -P tcptraceroute-1.5beta4/tcptraceroute.1 tcptraceroute-1.5beta5/tcptraceroute.1 --- tcptraceroute-1.5beta4/tcptraceroute.1 Wed Dec 31 19:00:00 1969 +++ tcptraceroute-1.5beta5/tcptraceroute.1 Thu Jul 3 00:01:53 2003 @@ -0,0 +1,156 @@ +.TH TCPTRACEROUTE 1 "2001 July 31" +.SH NAME +tcptraceroute \- A traceroute implementation using TCP packets +.SH SYNOPSIS +.B tcptraceroute [\-nNFSAE] [ \-i +.I interface +.B ] [ \-f +.I first ttl +.B ] +.br +.B [ \-l +.I length +.B ] [ \-q +.I number of queries +.B ] [ \-t +.I tos +.B ] +.br +.B [ \-m +.I max ttl +.B ] [ \-p +.I source port +.B ] [ \-s +.I source address +.B ] +.br +.B [ \-w +.I wait time +.B ] +.I host +.B [ +.I destination port +.B ] +.B [ +.I length +.B ] +.SH DESCRIPTION +.B tcptraceroute +is a traceroute implementation using TCP packets. +.P +The more traditional +.IR traceroute (8) +sends out either UDP or ICMP ECHO packets with a TTL of one, and increments +the TTL until the destination has been reached. By printing the gateways that +generate ICMP time exceeded messages along the way, it is able to determine the +path packets are taking to reach the destination. +.P +The problem is that with the widespread use of firewalls on the modern +Internet, many of the packets that +.IR traceroute (8) +sends out end up being filtered, making it impossible to completely trace the +path to the destination. However, in many cases, these firewalls will permit +inbound TCP packets to specific ports that hosts sitting behind the +firewall are listening for connections on. By sending out TCP SYN packets +instead of UDP or ICMP ECHO packets, +.B tcptraceroute +is able to bypass the most common firewall filters. +.P +It is worth noting that +.B tcptraceroute +never completely establishes a TCP connection with the destination host. +If the host is not listening for incoming connections, it will respond with +an RST indicating that the port is closed. If the host instead responds +with a SYN|ACK, the port is known to be open, and an RST is sent by the +kernel +.B tcptraceroute +is running on to tear down the connection without completing +three\-way handshake. This is the same half\-open scanning technique +that +.IR nmap (1) +uses when passed the +.BR \-sS +flag. +.SH OPTIONS +.IP \-n +Display numeric output, rather than doing a reverse DNS lookup for each hop. +By default, reverse lookups are never attempted on RFC1918 address space, +regardless of the \-n flag. +.IP \-N +Perform a reverse DNS lookup for each hop, including RFC1918 addresses. +.IP \-f +Set the initial TTL used in the first outgoing packet. The default is 1. +.IP \-m +Set the maximum TTL used in outgoing packets. The default is 30. +.IP \-p +Use the specified local TCP port in outgoing packets. The default is to +obtain a free port from the kernel using +.IR bind (2). +Unlike with traditional +.IR traceroute (8), +this number will not increase with each hop. +.IP \-s +Set the source address for outgoing packets. See also the \-i flag. +.IP \-i +Use the specified interface for outgoing packets. +.IP \-q +Set the number of probes to be sent to each hop. The default is 3. +.IP \-w +Set the timeout, in seconds, to wait for a response for each probe. The +default is 3. +.IP \-S +Set the TCP SYN flag in outgoing packets. This is the default, if neither +\-S or \-A is specified. +.IP \-A +Set the TCP ACK flag in outgoing packets. By doing so, it is possible to +trace through stateless firewalls which permit outgoing TCP connections. +.IP \-E +Send ECN SYN packets, as described in RFC2481. +.IP \-t +Set the IP TOS (type of service) to be used in outgoing packets. The +default is not to set any TOS. +.IP \-F +Set the IP "don't fragment" bit in outgoing packets. +.IP \-l +Set the total packet length to be used in outgoing packets. If the length +is greater than the minimum size required to assemble the necessary probe +packet headers, this value is automatically increased. +.IP \-d +Enable debugging, which may or may not be useful. +.SH EXAMPLES +Please see the +.I examples.txt +file included in the +.B tcptraceroute +distribution for a few real world examples. +.P +To trace the path to a web server listening for connections on port 80: +.P +.RS +.B tcptraceroute webserver +.RE +.P +To trace the path to a mail server listening for connections on port 25: +.P +.RS +.B tcptraceroute mailserver 25 +.RE +.SH BUGS +No error checking is performed on the source address specified by the \-s +flag, and it is therefore possible for +.B +tcptraceroute +to send out TCP SYN packets for which it has no chance of seeing a response +to. +.SH AUTHOR +Michael C. Toren +.SH AVAILABILITY +For updates, please see: +.br +.RS +http://michael.toren.net/code/tcptraceroute/ +.RE +.SH "SEE ALSO" +.IR traceroute (8), +.IR ping (8), +.IR nmap (1) diff -ru -b -P tcptraceroute-1.5beta4/tcptraceroute.1.html tcptraceroute-1.5beta5/tcptraceroute.1.html --- tcptraceroute-1.5beta4/tcptraceroute.1.html Wed Dec 31 19:00:00 1969 +++ tcptraceroute-1.5beta5/tcptraceroute.1.html Thu Jul 3 00:02:00 2003 @@ -0,0 +1,159 @@ + + + + + +TCPTRACEROUTE(1) manual page + + +Table of Contents

+ +

rcsE

+tcptraceroute - A traceroute implementation using TCP packets +

rcsOrcsS

+tcptraceroute +[-nNFSAE] [ -i interface ] [ -f first ttl ]
+[ -l length ] [ -q number of queries ] [ -t tos ]
+[ -m max ttl ] [ -p source port ] [ -s source address ]
+[ -w wait time ] host [ destination port ] [ length ] +

rcsCrcsTrcs

+tcptraceroute +is a traceroute implementation using TCP packets.

+The more traditional traceroute(8) +sends out either UDP or ICMP ECHO packets with a TTL of one, and increments +the TTL until the destination has been reached. By printing the gateways +that generate ICMP time exceeded messages along the way, it is able to +determine the path packets are taking to reach the destination.

+The problem +is that with the widespread use of firewalls on the modern Internet, many +of the packets that traceroute(8) sends out end up being filtered, making +it impossible to completely trace the path to the destination. However, +in many cases, these firewalls will permit inbound TCP packets to specific +ports that hosts sitting behind the firewall are listening for connections +on. By sending out TCP SYN packets instead of UDP or ICMP ECHO packets, +tcptraceroute is able to bypass the most common firewall filters.

+It is +worth noting that tcptraceroute never completely establishes a TCP connection +with the destination host. If the host is not listening for incoming connections, +it will respond with an RST indicating that the port is closed. If the +host instead responds with a SYN|ACK, the port is known to be open, and +an RST is sent by the kernel tcptraceroute is running on to tear down the +connection without completing three-way handshake. This is the same half-open +scanning technique that nmap(1) uses when passed the -sS flag. +

rcsIrcs

+ +
+ +
-n
+
Display +numeric output, rather than doing a reverse DNS lookup for each hop. By +default, reverse lookups are never attempted on RFC1918 address space, +regardless of the -n flag.
+ +
-N
+
Perform a reverse DNS lookup for each hop, including +RFC1918 addresses.
+ +
-f
+
Set the initial TTL used in the first outgoing packet. + The default is 1.
+ +
-m
+
Set the maximum TTL used in outgoing packets. The default +is 30.
+ +
-p
+
Use the specified local TCP port in outgoing packets. The default +is to obtain a free port from the kernel using bind(2). Unlike with traditional +traceroute(8), this number will not increase with each hop.
+ +
-s
+
Set the source +address for outgoing packets. See also the -i flag.
+ +
-i
+
Use the specified interface +for outgoing packets.
+ +
-q
+
Set the number of probes to be sent to each hop. +The default is 3.
+ +
-w
+
Set the timeout, in seconds, to wait for a response for +each probe. The default is 3.
+ +
-S
+
Set the TCP SYN flag in outgoing packets. + This is the default, if neither -S or -A is specified.
+ +
-A
+
Set the TCP ACK flag +in outgoing packets. By doing so, it is possible to trace through stateless +firewalls which permit outgoing TCP connections.
+ +
-E
+
Send ECN SYN packets, +as described in RFC2481.
+ +
-t
+
Set the IP TOS (type of service) to be used in +outgoing packets. The default is not to set any TOS.
+ +
-F
+
Set the IP "don't fragment" +bit in outgoing packets.
+ +
-l
+
Set the total packet length to be used in outgoing +packets. If the length is greater than the minimum size required to assemble +the necessary probe packet headers, this value is automatically increased. +
+ +
-d
+
Enable debugging, which may or may not be useful.
+
+ +

rcsMrcsS

+Please see the +examples.txt file included in the tcptraceroute distribution for a few real +world examples.

+To trace the path to a web server listening for connections +on port 80:

+

tcptraceroute webserver
+

+To trace the path to a mail server +listening for connections on port 25:

+

tcptraceroute mailserver 25
+ +

rcsS

+No +error checking is performed on the source address specified by the -s flag, +and it is therefore possible for tcptraceroute to send out TCP SYN packets +for which it has no chance of seeing a response to. +

rcsHrcs rcs rcs rcskrcs +rcs rcscrcst rcs rcscrcscrcsf rcsircsa rcsprcse

+Michael C. Toren <mct@toren.net> + +

rcsIrcsIrcsY

+For updates, please see:
+
http://michael.toren.net/code/tcptraceroute/
+ +

rcs rcsO

+traceroute(8), ping(8), +nmap(1)

+ +


+Table of Contents

+

+ Only in tcptraceroute-1.5beta4: tcptraceroute.8 Only in tcptraceroute-1.5beta4: tcptraceroute.8.html diff -ru -b -P tcptraceroute-1.5beta4/tcptraceroute.c tcptraceroute-1.5beta5/tcptraceroute.c --- tcptraceroute-1.5beta4/tcptraceroute.c Sun Jun 29 16:10:57 2003 +++ tcptraceroute-1.5beta5/tcptraceroute.c Thu Jul 3 15:56:41 2003 @@ -613,7 +613,11 @@ salen = sizeof(*ifrp); if (ioctl(s, SIOCGIFADDR, &ifr) < 0) - pfatal("ioctl(SIOCGIFADDR)"); + { + debug("ioctl(SIOCGIFADDR) on unconfigured interface %s failed; skipping\n", + sprintable(ifr.ifr_name)); + continue; + } addr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr; #endif /* HAVE_SOCKADDR_SA_LEN else */ @@ -1115,11 +1119,12 @@ debug("pcap filter is: %s\n", o_nofilter ? "(nothing)" : filter); + if (pcap_lookupnet(device, &localnet, &netmask, errbuf) < 0) + { + warn("pcap_lookupnet failed: %s\n", errbuf); localnet = 0; netmask = 0; - - if (pcap_lookupnet(device, &localnet, &netmask, errbuf) < 0) - fatal("pcap_lookupnet failed: %s\n", errbuf); + } if (pcap_compile(pcap, &fcode, filter, 1, netmask) < 0) fatal("filter compile failed: %s", pcap_geterr(pcap)); @@ -1130,6 +1135,8 @@ pcap_fd = pcap_fileno(pcap); if (fcntl(pcap_fd, F_SETFL, O_NONBLOCK) < 0) pfatal("fcntl(F_SETFL, O_NONBLOCK) failed"); + + pcap_freecode(&fcode); } /* @@ -1867,7 +1874,7 @@ case 'd': o_debug++; - debug("%s %s\n", PACKAGE, VERSION); + debug("%s %s, %s\n", PACKAGE, VERSION, TARGET); debug("Compiled with libpcap %s, libnet %s (API %d)\n", pcap_version, LIBNET_VERSION, LIBNET_API_VERSION); break; diff -ru -b -P tcptraceroute-1.5beta4/tcptraceroute.lsm tcptraceroute-1.5beta5/tcptraceroute.lsm --- tcptraceroute-1.5beta4/tcptraceroute.lsm Sun Jun 29 17:12:21 2003 +++ tcptraceroute-1.5beta5/tcptraceroute.lsm Thu Jul 3 12:08:45 2003 @@ -1,7 +1,7 @@ Begin4 Title: tcptraceroute -Version: 1.5beta4 -Entered-date: 2003-06-29 +Version: 1.5beta5 +Entered-date: 2003-07-02 Description: A traceroute implementation using TCP packets Keywords: network, traceroute, firewall Author: mct@toren.net (Michael C. Toren)