Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/traceroute merge in traceroute1.4a12. Our sources a...



details:   https://anonhg.NetBSD.org/src/rev/1886f52936c0
branches:  trunk
changeset: 769466:1886f52936c0
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 11 01:06:26 2011 +0000

description:
merge in traceroute1.4a12. Our sources are so different that it is really
difficult to do this with an import.

diffstat:

 usr.sbin/traceroute/CHANGES      |   72 ++++++++++-
 usr.sbin/traceroute/Makefile     |    3 +-
 usr.sbin/traceroute/ifaddrlist.c |    7 +-
 usr.sbin/traceroute/traceroute.8 |   40 ++++--
 usr.sbin/traceroute/traceroute.c |  240 ++++++++++++++++++++++++--------------
 usr.sbin/traceroute/version.c    |    4 +-
 6 files changed, 253 insertions(+), 113 deletions(-)

diffs (truncated from 756 to 300 lines):

diff -r b76d163f0f98 -r 1886f52936c0 usr.sbin/traceroute/CHANGES
--- a/usr.sbin/traceroute/CHANGES       Sat Sep 10 21:40:43 2011 +0000
+++ b/usr.sbin/traceroute/CHANGES       Sun Sep 11 01:06:26 2011 +0000
@@ -1,7 +1,7 @@
-$NetBSD: CHANGES,v 1.1.1.1 1997/10/03 22:25:19 christos Exp $
-@(#) Header: CHANGES,v 1.17 97/06/13 02:27:02 leres Exp  (LBL)
+$NetBSD: CHANGES,v 1.2 2011/09/11 01:06:26 christos Exp $
+@(#) Id: CHANGES,v 1.23 2000/12/14 06:53:11 leres Exp  (LBL)
 
-v1.4 Fri Jun 13 02:23:51 PDT 1997
+v1.4 Wed Dec 13 22:50:35 PST 2000
 
 - Add an option to use icmp echo instead of udp datagrams.
 
@@ -12,8 +12,6 @@
 
 - Added flags to set the first ttl and to set the don't fragment bit.
 
-- Removed dependence on strdup().
-
 - Add a local autoconf macro to check for routines in libraries; the
   autoconf version is broken (it only puts the library name in the
   cache variable name). Thanks to John Hawkinson.
@@ -21,6 +19,70 @@
 - Add a local autoconf macro to check for types; the autoconf version
   is broken (it uses grep instead of actually compiling a code fragment).
 
+- Attempt to detect "egcs" versions of gcc.
+
+- Fix problems caused by savestr().
+
+- Detect when there are more interfaces than we can deal with. Thanks
+  to Guy Harris guy%netapp.com@localhost.
+
+- Accommodate changes made to FreeBSD 3.2-RELEASE network headers files.
+
+- The ip header offset needs to be byte swapped under Solaris on the
+  intel as well. Reported by John McDermott (jjm%jkintl.com@localhost) Also byte
+  ip length and offset for linux.
+
+- In wait_for_reply(), use passed socket instead of global one. Thanks
+  to Richard Kettlewell (richard.kettlewell%kewill.com@localhost)
+
+- Check for IFF_LOOPBACK as a define or an enum (concession to linux).
+  Reported by Robert Bihlmeyer (robbe%orcus.priv.at@localhost)
+
+- Increase size of SIOCGIFCONF buffer to accommodate systems with lots
+  of virtual interfaces. Ignore sun virtual interfaces. Suggested by
+  Ian Donaldson (iand%aone.com.au@localhost)
+
+- Always calculate icmp checksums when using -I. Reported by Soumen
+  (sbiswas%novell.com@localhost)
+
+- Documentation fix for description of -p. Thanks to Jeffrey C Honig
+  (jch%bsdi.com@localhost)
+
+- Enable ip checksums for Solaris 2.6 and higher (since they seem to
+  work correctly now).
+
+- Avoid problems when broken routers return 0.0.0.0 as their source
+  address. Thanks to John Hawkinson (jhawk%bbnplanet.com@localhost)
+
+- Canonicalize hostname if gethostname() doesn't return a domain.
+
+- Add -z flag (pause msecs) to allow optional pause between probes.
+  Suggested by Dave Morrison (drmorris%uplanet.com@localhost)
+
+- Fix max packet length test.
+
+- Use "/dev/null" instead of "." for file descriptor fodder.
+  Suggested by Tim Robbins (fyre%box3n.gumbynet.org@localhost)
+
+- Watch for a NULL argv[0]. Suggested by Tim Robbins.
+
+- Be careful with hostname legnths.
+
+- Print RFC1191 Path MTU Discovery value on "needfrag" unreachables.
+
+- Limit port size to 16 bits. Suggested by Tim Robbins.
+
+- Limit wait time to 24 hours.
+
+- Modified linux specific struct ipovly definition to avoid problems
+  with 64 bit systems. Problem reported by Uros Prestor
+  (uros%turbolinux.com@localhost)
+
+- Use kernel routing tables to determine correct source address.
+  Three styles are supported: bsd/socket, solaris/mib and linux.
+
+- Fix configure to recognize older versions of Solaris.
+
 v1.3.2 Thu Sep 26 18:06:16 PDT 1996
 
 - Rewrite source routing code to eliminate a number of problems on
diff -r b76d163f0f98 -r 1886f52936c0 usr.sbin/traceroute/Makefile
--- a/usr.sbin/traceroute/Makefile      Sat Sep 10 21:40:43 2011 +0000
+++ b/usr.sbin/traceroute/Makefile      Sun Sep 11 01:06:26 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.18 2011/05/10 01:52:49 christos Exp $     
+#      $NetBSD: Makefile,v 1.19 2011/09/11 01:06:26 christos Exp $     
 
 USE_FORT?= yes # network client
 
@@ -8,6 +8,7 @@
 CPPFLAGS+=-DHAVE_MALLOC_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKIO_H=1
 CPPFLAGS+=-DHAVE_STRERROR=1 -DHAVE_SETLINEBUF=1 -DHAVE_SOCKADDR_SA_LEN=1 
 CPPFLAGS+=-DHAVE_RAW_OPTIONS=1
+CPPFLAGS+=-DHAVE_ICMP_NEXTMTU=1
 
 CPPFLAGS+=-DIPSEC
 LDADD+=        -lipsec
diff -r b76d163f0f98 -r 1886f52936c0 usr.sbin/traceroute/ifaddrlist.c
--- a/usr.sbin/traceroute/ifaddrlist.c  Sat Sep 10 21:40:43 2011 +0000
+++ b/usr.sbin/traceroute/ifaddrlist.c  Sun Sep 11 01:06:26 2011 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ifaddrlist.c,v 1.9 2011/05/11 00:38:28 christos Exp $  */
+/*     $NetBSD: ifaddrlist.c,v 1.10 2011/09/11 01:06:26 christos Exp $ */
 
 /*
- * Copyright (c) 1997
+ * Copyright (c) 1997, 1998, 1999, 2000
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,8 +38,9 @@
 #if 0
 static const char rcsid[] =
     "@(#) Header: ifaddrlist.c,v 1.2 97/04/22 13:31:05 leres Exp  (LBL)";
+    "@(#) Id: ifaddrlist.c,v 1.9 2000/11/23 20:01:55 leres Exp  (LBL)";
 #else
-__RCSID("$NetBSD: ifaddrlist.c,v 1.9 2011/05/11 00:38:28 christos Exp $");
+__RCSID("$NetBSD: ifaddrlist.c,v 1.10 2011/09/11 01:06:26 christos Exp $");
 #endif
 #endif
 
diff -r b76d163f0f98 -r 1886f52936c0 usr.sbin/traceroute/traceroute.8
--- a/usr.sbin/traceroute/traceroute.8  Sat Sep 10 21:40:43 2011 +0000
+++ b/usr.sbin/traceroute/traceroute.8  Sun Sep 11 01:06:26 2011 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: traceroute.8,v 1.28 2006/02/17 21:31:18 rpaulo Exp $
+.\" $NetBSD: traceroute.8,v 1.29 2011/09/11 01:06:26 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1995, 1996, 1997
 .\"    The Regents of the University of California.  All rights reserved.
@@ -15,9 +15,9 @@
 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
-.\"    Header: traceroute.8,v 1.11 97/04/22 13:45:13 leres Exp
+.\"    Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp
 .\"
-.TH TRACEROUTE 8 "17 February 2006"
+.TH TRACEROUTE 8 "21 September 2000"
 .UC 6
 .SH NAME
 traceroute \- print the route packets take to network host
@@ -63,6 +63,10 @@
 .B \-w
 .I waittime
 ] [
+.B \-z
+.I pausemsecs
+ ]
+] [
 .B \-A
 .I as_server
 ]
@@ -206,14 +210,20 @@
 sec.).
 .TP
 .B \-x
-Toggle checksums. Normally, this prevents traceroute from calculating
-checksums. In some cases, the operating system can overwrite parts of
+Toggle ip checksums. Normally, this prevents traceroute from calculating
+ip checksums. In some cases, the operating system can overwrite parts of
 the outgoing packet but not recalculate the checksum (so in some cases
 the default is to not calculate checksums and using
 .B \-x
 causes them to be calculated). Note that checksums are usually required
 for the last hop when using ICMP ECHO probes
 .RB ( \-I ).
+So they are always calculated when using ICMP.
+.TP
+.B \-z
+Set the time (in milliseconds) to pause between probes (default 0).
+Some systems such as Solaris and routers such as Ciscos rate limit
+icmp messages. A good value to use with this this is 500 (e.g. 1/2 second).
 .PP
 This program attempts to trace the route an IP packet would follow to some
 internet host by launching UDP probe
@@ -349,16 +359,20 @@
 .BR !N ,
 or
 .B !P
-(got a host, network or protocol unreachable, respectively),
+(host, network or protocol unreachable),
 .B !S
-or
-.B !F
-(source route failed or fragmentation needed \- neither of these should
-ever occur and the associated gateway is busted if you see one),
+(source route failed),
+.B !F\-<pmtu>
+(fragmentation needed \- the RFC1191 Path MTU Discovery value is displayed),
 .B !X
-(communication administratively prohibited), or
+(communication administratively prohibited),
+.B !V
+(host precedence violation),
+.B !C
+(precedence cutoff in effect), or
 .B !\*[Lt]N\*[Gt]
-(ICMP unreachable code N).
+(ICMP unreachable code \*[Lt]num\*[Gt]).
+These are defined by RFC1812 (which supersedes RFC1716).
 If almost all the probes result in some kind of unreachable, traceroute
 will give up and exit.
 
@@ -395,7 +409,7 @@
 The current version is available via anonymous ftp:
 .LP
 .RS
-.I ftp://ftp.ee.lbl.gov/traceroute.tar.Z
+.I ftp://ftp.ee.lbl.gov/traceroute.tar.gz
 .RE
 .SH BUGS
 Please send bug reports to traceroute%ee.lbl.gov@localhost.
diff -r b76d163f0f98 -r 1886f52936c0 usr.sbin/traceroute/traceroute.c
--- a/usr.sbin/traceroute/traceroute.c  Sat Sep 10 21:40:43 2011 +0000
+++ b/usr.sbin/traceroute/traceroute.c  Sun Sep 11 01:06:26 2011 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: traceroute.c,v 1.78 2011/05/12 01:59:16 christos Exp $ */
+/*     $NetBSD: traceroute.c,v 1.79 2011/09/11 01:06:26 christos Exp $ */
 
 /*
- * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997
+ * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,11 +25,12 @@
 #ifndef lint
 #if 0
 static const char rcsid[] =
-    "@(#)Header: traceroute.c,v 1.49 97/06/13 02:30:23 leres Exp  (LBL)";
+    "@(#)Id: traceroute.c,v 1.68 2000/12/14 08:04:33 leres Exp  (LBL)";
 #else
-__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997\
+__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997,\
+ 1998, 1999, 2000\
  The Regents of the University of California.  All rights reserved.");
-__RCSID("$NetBSD: traceroute.c,v 1.78 2011/05/12 01:59:16 christos Exp $");
+__RCSID("$NetBSD: traceroute.c,v 1.79 2011/09/11 01:06:26 christos Exp $");
 #endif
 #endif
 
@@ -244,6 +245,17 @@
 #include "os-proto.h"
 #endif
 
+/* rfc1716 */
+#ifndef ICMP_UNREACH_FILTER_PROHIB
+#define ICMP_UNREACH_FILTER_PROHIB     13      /* admin prohibited filter */
+#endif
+#ifndef ICMP_UNREACH_HOST_PRECEDENCE
+#define ICMP_UNREACH_HOST_PRECEDENCE   14      /* host precedence violation */
+#endif
+#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF
+#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15      /* precedence cutoff */
+#endif
+
 #include "ifaddrlist.h"
 #include "as.h"
 #include "prog_ops.h"
@@ -323,6 +335,14 @@
 #endif
 };
 
+#ifndef HAVE_ICMP_NEXTMTU
+/* Path MTU Discovery (RFC1191) */
+struct my_pmtu {
+       u_short ipm_void;
+       u_short ipm_nextmtu;
+};
+#endif
+
 static u_char  packet[512];            /* last inbound (icmp) packet */
 
 static struct ip *outip;               /* last output (udp) packet */
@@ -338,17 +358,22 @@
 static int s;                          /* receive (icmp) socket file descriptor */
 static int sndsock;                    /* send (udp/icmp) socket file descriptor */
 
-static struct sockaddr whereto;        /* Who to try to reach */
-static struct sockaddr_in wherefrom;   /* Who we are */
+static struct sockaddr whereto;                /* Who to try to reach */
+static struct sockaddr wherefrom;      /* Who we are */
 static int packlen;                    /* total length of packet */
 static int minpacket;                  /* min ip packet size */
 static int maxpacket = 32 * 1024;      /* max ip packet size */



Home | Main Index | Thread Index | Old Index