Home | History | Annotate | Download | only in traceroute
History log of /src/usr.sbin/traceroute/traceroute.c
RevisionDateAuthorComments
 1.84  19-Jan-2018  maxv Fix build failure, the structure is already defined now.
 1.83  17-Feb-2016  christos PR/50821: David Binderman: remove "i <" i <
 1.82  26-Oct-2015  shm Added missed break statement. (Missed break in -z option implicitly implies
-P option)
 1.81  16-Aug-2012  zafer Pretty print multipath routes. From FreeBSD.

ok christos@
 1.80  04-Jan-2012  drochner branches: 1.80.2; 1.80.4;
include <netipsec/ipsec.h> rather than <netinet6/ipsec.h> from userland
where possible, for consistency and compatibility to FreeBSD
(exception: KAME specific statistics gathering in netstat(1) and systat(1))
 1.79  11-Sep-2011  christos branches: 1.79.2;
merge in traceroute1.4a12. Our sources are so different that it is really
difficult to do this with an import.
 1.78  12-May-2011  christos use err(3) and warn(3) for error and warning printing, tiny knf.
 1.77  10-May-2011  christos Add AS support for traceroute6. While here cleanup both traceroute programs
a bit.
XXX: Error printing on traceroute should be revisited.
 1.76  15-Dec-2010  pooka Use RUMPPRG. I think it's safe to say there's not going to be a
new upstream version of traceroute to import.

AS# lookup is still done using host networking. Rationale: the
relevance to where that data comes from with respect to network
tracing is zero (be it socket, local file, db, whatever).
 1.75  02-Jul-2010  kefren Fix incomplete extensions sanity checks
 1.74  21-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.73  17-Jul-2008  christos Use htonl like ping/traceroute6 do, from Markus Mayer
 1.72  16-Jul-2008  christos PR/39157: Markus Mayer: traceroute not 64 bit aware (struct timeval issue)
 1.71  16-Jan-2008  seanb branches: 1.71.6;
- Set progname before dereference.
 1.70  15-Dec-2007  perry replace instances of __attribute__((__packed__)) with __packed
 1.69  08-Apr-2007  scw branches: 1.69.4;
Undo a workaround for an old SH5 toolchain bug.
No functional change.
 1.68  07-Oct-2006  elad branches: 1.68.2; 1.68.4;
PR/18906: roskens at elfin dot net: misc. select() to poll() updates.

Adapted to -current by myself, thanks for the patch!
 1.67  07-Oct-2006  elad PR/19069: Jun-ichiro itojun Hagino: traceroute(8) and traceroute6(8) can
send packet to udp port 0, which is illegal
 1.66  24-Sep-2006  elad Move socket calls way up and drop root privileges sooner.
 1.65  31-May-2006  rpaulo Add missing coma.
 1.64  31-May-2006  rpaulo It doesn't make sense to print the MPLS ttl here.
While here, make the output look like Cisco IOS. Suggested by Mihai CHELARU.
 1.63  09-May-2006  mrg change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
 1.62  17-Feb-2006  rpaulo Show MPLS ICMP extensions. Only available if -M is passed.
Example:
RC02-02 (195.245.142.66) 45.707 ms 20.418 ms 34.042 ms [MPLS: label: 515, exp: 0x0, ttl: 1]
gr1-p340.attga.ip.att.net (12.123.20.190) 241.878 ms 251.945 ms [MPLS: label: 32133, exp: 0x0, ttl: 1]


Based on PR 22523: By Jesper Skriver (updated by ww@parc.styx.org and Mihai
CHELARU).

Things not in the PR that I changed/added:
* changed exp and label to lower case
* added ttl (probably not worth it but who knows..)
* KNF/style/indent
* C99 uintXX_t
 1.61  22-Apr-2004  itojun do not disclose endian/pid. henning@openbsd
 1.60  05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.59  17-May-2003  itojun strncpy -> strlcpy
 1.58  15-May-2003  itojun traceroute.c doesn't use savestr()
 1.57  16-Nov-2002  itojun die if strdup failure
 1.56  16-Nov-2002  itojun strto* audit.
 1.55  01-Oct-2002  itojun poll.h, not sys/poll.h
 1.54  18-Sep-2002  mycroft select() -> poll()
 1.53  12-Aug-2002  itojun it is no use to do SO_DONTROUTE on receive socket. stevesk@openbsd
 1.52  09-Aug-2002  itojun no need for struct timezone. From: Kevin Steves <kevin@atomicgears.com>
 1.51  01-Aug-2002  itojun correct in_cksum2 for odd length case
 1.50  01-Aug-2002  itojun kill register variable decls, they are meaningless these days
 1.49  01-Aug-2002  itojun u_short cleansing (use u_int16_t where appropriate).
XXX in_cksum2 does not seem correct in odd length case
 1.48  11-Jul-2002  scw Work-around an internal compiler error on the SuperH sh5 toolchain.
 1.47  29-Jun-2002  itojun it is highly unlikely that protocol # for ip/icmp to change. from deraadt.
 1.46  26-May-2002  itojun grab max hlim/ttl from kernel via sysctl. sync w/openbsd
 1.45  12-Jan-2002  yamt check if timeout already expired before select.
from OpenBSD/FreeBSD.
 1.44  04-Nov-2001  atatat Add support for printing the AS number associated with the address at
each hop.
 1.43  09-Oct-2001  yamt fix lsrr.
 1.42  12-Jan-2001  itojun correct fd_set allocation. from deraadt
 1.41  07-Oct-2000  itojun avoid fd_set overflow. see openbsd select(2).
XXX should we use poll(2)?
 1.40  30-Sep-2000  sommerfeld Avoid using savestr() on something which will later be passed to
free(). Raised as a potential security issue on bugtraq. No actual
exploits known.
 1.39  31-Jan-2000  itojun branches: 1.39.4;
sync with latest libipsec/kernel.
 1.38  25-Jan-2000  sommerfeld Fix use of -I and -P at the same time by refactoring so there's only
one set of code which knows how to resize the packet.
Report when we shrink MTU because of an EMSGSIZE return; fix
formatting to let this not look ugly.
Add a few likely MTU's to the table (1480 and 1280).
 1.37  03-Sep-1999  itojun configure IPsec policy on sending/receiving socket for bypassing IPsec.

If IPsec default policy is configured for destination
traceroute will never success (because encrypted icmp timexceeded
is unrecognizable).
 1.36  19-Jun-1999  kim Only require half of the responses to indicate that the destination is
unreachable. This makes traceroute exit when it encounters a Cisco, which
typically does not respond to every other probe (or so) when either there
is no route to the destionation or an access list is blocking the probes.
 1.35  16-Jun-1999  is Add sanity check for MTU size in fragmentation required packets.
 1.34  16-Jun-1999  is Factor out common code in the fragmentation required branch.
 1.33  16-Jun-1999  is Don't forget to update the UDP length when changing the packet length.
Reported by Johan Danielsson in PR 7781; the fix is an updated version
(by the same person) of the patch in the PR.
 1.32  16-Jun-1999  is Cosmetics: a) add missing \n-s, b) this is ntohs, not htons, here.
 1.31  05-Jun-1999  tron Fix byte ordering problem on little endian systems. Patch supplied by
Jarle Greipsland in PR bin/7700.
 1.30  17-Feb-1999  christos branches: 1.30.2;
Limit wait time, so that people cannot use this as a flooding tool.
From bugtraq, but fixed differently than suggested.
 1.29  16-Feb-1999  cjs Oops. We don't need limits.h in this program.
 1.28  16-Feb-1999  cjs If not root, make sure source address matches a local interface.
 1.27  16-Feb-1999  cjs Check select() return value, and abort the program if an error is
returned. Otherwise after sending a packet, select() may return
immediately (if there's an error of some sort) and traceroute
solders on, sending more packets with no delay in between. This is
effectively a small flood attack.
 1.26  09-Dec-1998  tron Use a little bit of magic suggested by Ken Hornstein to find an
appropriate source address for the UDP packets. Fixes PR bin/4427
by Luke Mewburn.
 1.25  27-Aug-1998  ross {} fixes from Erik Bertelsen <erik@erik-be.uni-c.dk> (PR 6047) to shut up egcs.
 1.24  17-Jul-1998  is Add path mtu discovery. Idea and code fragments by W. Richard Stevens.
 1.23  06-Jul-1998  mrg - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
 1.22  04-Jul-1998  mrg ensure we do not overrun errbuf.
 1.21  03-Nov-1997  ross Much cleaner fix for alignment error bug.
 1.20  31-Oct-1997  ross Eliminate some alignment assumptions in packed IP/UDP frames. (port-alpha issue)
 1.19  17-Oct-1997  lukem branches: 1.19.2;
getopt returns -1 not EOF
 1.18  04-Oct-1997  christos Fix conflicts.
 1.17  02-Sep-1997  is Make it recognize ICMP_UNREACH_ADMIN_PROHIBITED (type 13) as !A, and print
!{number} for unknown numbers.
This patch is part of PR 4038 by Havard Eidnes <he@vader.runit.sintef.no>,
who in turn did loosely base his patch on the FreeBSD 2.2.2 version.
 1.16  13-Apr-1997  mrg be safe with buffers.
 1.15  27-Sep-1996  thorpej Add a -l flag, which displays the ttl of the returned packet.
From D'Arcy J.M. Cain <darcy@druid.com>, PR #2773.
 1.14  11-Sep-1996  explorer fix two security holes; recently posted to freebsd-bugs
 1.13  16-Aug-1996  explorer Do the timeout in bin/2701 a bit differently.
 1.12  16-Aug-1996  explorer Fix traceroute timeout problems and a printing problem. Closes pr bin/2701
 1.11  30-Jun-1996  jtc Fixed reversed inet_aton condition test; From PR #2579
 1.10  21-May-1995  mycroft Use inet_aton(), not inet_addr().
 1.9  27-Mar-1995  glass botched rcsid fix completely..
 1.8  26-Mar-1995  glass new rcsid format. small cleanup
 1.7  21-Mar-1995  mycroft Remove unused tvsub().
 1.6  04-Jan-1995  mycroft Convert a few more.
 1.5  04-Jan-1995  mycroft Convert some things to use err*()/warn*().
 1.4  04-Jan-1995  mycroft Add a `-g' option for loose source routing, as implemented by John Hawkinson
and I.
 1.3  16-May-1994  mycroft Update from 4.4-Lite.
 1.2  01-Aug-1993  mycroft Add RCS identifiers.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3  03-Oct-1997  christos Import LBL's traceroute-1.4a5
 1.1.1.2  13-Feb-1997  mrg lite2
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.19.2.2  04-Nov-1997  mellon Pull rev 1.21 up from trunk (ross)
 1.19.2.1  01-Nov-1997  mellon Pull rev 1.20 up from trunk (ross)
 1.30.2.3  19-Oct-2000  he Pull up revision 1.40 (requested by sommerfeld):
Avoid using savestr() on something which will later be passed to
free(). Raised as a potential security issue on bugtraq. No
actual exploits known.
 1.30.2.2  28-Jun-1999  perry pullup 1.35->1.36 (Kimmo Suominen)
 1.30.2.1  23-Jun-1999  perry pullup 1.30->1.31, 1.32->1.33 (is)
 1.39.4.2  18-Oct-2000  tv Pullup 1.41 [itojun]:
avoid fd_set overflow
 1.39.4.1  30-Sep-2000  sommerfeld src/usr.sbin/traceroute/traceroute.c 1.40

Avoid calling savestr() to create a string which will later be passed
to free()

Pull up approved by jhawk.
 1.68.4.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.68.2.1  19-Jul-2007  liamjfoy Pull up following revision(s) (requested by soren in ticket #774):
build.sh: revision 1.169
gnu/usr.bin/gcc4/backend/Makefile: revision 1.9
sys/arch/evbsh5/README: revision 1.1
distrib/notes/common/contents: revision 1.124
usr.sbin/ndbootd/ndbootd.c: revision 1.12
gnu/lib/libopcodes/arch/sh3eb/defs.mk: revision 1.4
gnu/lib/libbfd/arch/sh3eb/defs.mk: revision 1.8
libexec/ld.elf_so/Makefile: revision 1.78
gnu/dist/binutils/bfd/config.bfd: revision 1.14
doc/HACKS: revision 1.93
distrib/cdrom/current.conf: revision 1.8
gnu/lib/libgcc4/Makefile.inc: revision 1.6
share/mk/sys.mk: revision 1.90
distrib/sets/lists/base/mi: revision 1.700
libexec/ld.elf_so/rtld.c: revision 1.112
distrib/sets/lists/base/mi: revision 1.702
sys/arch/sh5/README: revision 1.1
gnu/lib/libbfd/arch/sh3el/bfd.h: revision 1.7
usr.sbin/traceroute/traceroute.c: revision 1.69
distrib/notes/common/main: revision 1.330
distrib/notes/common/list-setsizes.sh: revision 1.2
sys/arch/Makefile: revision 1.35
gnu/lib/libopcodes/arch/sh3el/defs.mk: revision 1.4
gnu/lib/libbfd/arch/sh3el/defs.mk: revision 1.8
share/mk/bsd.own.mk: revision 1.495
gnu/lib/libbfd/arch/sh3eb/bfd.h: revision 1.7
x11/lib/OSmesa/Makefile: revision 1.20
sys/dev/dkwedge/dkwedge_bsdlabel.c: revision 1.13
gnu/dist/binutils/opcodes/configure.in: revision 1.2
gnu/dist/binutils/opcodes/configure: revision 1.2
gnu/usr.bin/send-pr/categories: revision 1.53
etc/mtree/NetBSD.dist: revision 1.339
sys/arch/README: revision 1.42
lib/libc/gdtoa/Makefile.inc: revision 1.6
usr.bin/crunch/crunchide/Makefile: revision 1.16
sys/lkm/net/bsdcomp/Makefile: revision 1.5
regress/sys/uvm/Makefile: revision 1.6
etc/MAKEDEV.awk: revision 1.18
x11/Xserver/GL/GLcore/Makefile.GLcore: revision 1.10
sys/contrib/dev/ath/netbsd/Makefile.ath.inc: revision 1.14
gnu/lib/libbfd/Makefile: revision 1.42
doc/RESPONSIBLE: revision 1.78
Remove evbsh5.
 1.69.4.2  23-Mar-2008  matt sync with HEAD
 1.69.4.1  09-Jan-2008  matt sync with HEAD
 1.71.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.79.2.2  30-Oct-2012  yamt sync with head
 1.79.2.1  17-Apr-2012  yamt sync with head
 1.80.4.1  01-Nov-2012  matt sync with netbsd-6-0-RELEASE.
 1.80.2.1  01-Oct-2012  riz Pull up following revision(s) (requested by zafer in ticket #573):
usr.sbin/traceroute/traceroute.c: revision 1.81
Pretty print multipath routes. From FreeBSD.
ok christos@

RSS XML Feed