summaryrefslogtreecommitdiffstats
path: root/contrib/traceroute/traceroute.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r283784:tuexen2015-06-031-18/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove trailing whitespaces. MFC r283785: Require the embedded packet to contain 8 bytes after the IP header instead of only 4. This is guaranteed by RFC 792 and the verification of GRE, ICMP and TCP packets use 8 bytes. MFC r283786: There is no payload anymore. So compute the minimum packet length correctly and use 40 as the default (if the minumum allows it), as specified in the man page. MFC r283806: When the packet verification fails in verbose mode, print the correct number of words in host byte order. Also remove a stray 'x'. MFC r283808: Don't send malformed SCTP probe packets. MFC r283813: Use an empty string for field descriptions of unknown protocols. MFC r283817: Don't send illegal packets when using UDP-Lite. MFC r283819: A TCP checksum of 0 is completely valid. Mapping 0 to 0xffff only applies to UDP and UDP-Lite. MFC r283820: The code starts with base + 1 as the first port. Fix to documentation to match that.
* Fix a bug in the TCP tracerouting which resulted in not accepting anytuexen2012-04-261-4/+3
| | | | | | incoming packets. So all packets seemed to be lost. MFC after: 1 week
* For some reason, contrib/traceroute/traceroute.c ensures MAXHOSTNAMELENdim2011-06-261-1/+1
| | | | | | | | is defined, but then proceeds to use a hardcoded maximum hostname length of 64 anyway. Fix this by checking against MAXHOSTNAMELEN instead. PR: bin/157732 MFC after: 3 days
* Check return code of setuid() in traceroute.simon2011-04-231-1/+4
| | | | | | | While it will not fail in normal circumstances, better safe than sorry. Reported by: LLVM's clang static analyzer MFC after: 3 days
* traceroute(8): make WARNS=3 cleanuqs2010-12-041-8/+5
| | | | Also fixes an operator precedence bug for TCP tracerouting
* Remove unused traceroute(8) contrib code from headuqs2010-11-271-5/+0
| | | | It still lives on under vendor/traceroute.
* Remove unneeded struct timezone passed to gettimeofday().ed2010-08-081-5/+3
|
* - Add AS lookup functionality to traceroute6(8) as well.ume2009-08-231-4/+6
| | | | | | | | | - Support for IPv6 transport for AS lookup. - Introduce $RA_SERVER to set whois server. - Support for 4 byte ASN. - ANSIfy function declaration in as.c. Tested by: IHANet folks.
* Add AS lookup functionality. On each hop we query a whois server torpaulo2008-02-201-4/+31
| | | | | | | | | | find the corresponding AS for that IP (-a switch). We can also choose a different whois server with the -A switch. The default is whois.radb.net. Obtained from: NetBSD Reviewed by: bms, njl (mentor) Approved by: njl (mentor)
* Commit IPv6 support for FAST_IPSEC to the tree.gnn2007-07-011-1/+1
| | | | | | | | This commit includes all remaining changes for the time being including user space updates. Submitted by: bz Approved by: re
* o I failed to find a suitable explanation why traceroute(8) andmaxim2007-04-301-1/+1
| | | | | | | | | | traceroute6(8) force -w flag (wait time) to be > 1 sec. Make it possible to use 1 sec wait time. PR: bin/110933 Submitted by: Dmitry Marakasov Reviewed by: freebsd-net (silence) MFC after: 1 month
* Make it so that the synopsis and usage message almost agree.dwmalone2006-10-151-1/+1
| | | | MFC after: 3 weeks
* Add a -D option to traceroute that prints the differences betweendwmalone2006-10-151-4/+54
| | | | | | | | the probe packet we sent and the packet quoted by the ICMP response. Can be useful for spotting hops that change the packet in-flight or have problems generating correct ICMP responses. MFC after: 3 weeks
* Make traceroute decode all the ICMP unreachable messages defineddwmalone2006-06-131-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in http://www.iana.org/assignments/icmp-parameters. Thankfully IANA's list aggrees with <netinet/ip_icmp.h>. I've tried to do this in a way which is mostly consistent with tcptraceroute and Debian's version of traceroute. However, sometimes a letter is used twice by these versions, so I've gone with: LBL tcptr Debian (chosen) ICMP_UNREACH_NET !N !N !N !N ICMP_UNREACH_HOST !H !H !H !H ICMP_UNREACH_PROTOCOL !P !P !P !P ICMP_UNREACH_PORT ! !p ! ! ICMP_UNREACH_NEEDFRAG !F-%d !F !F-<%d> !F-<%d> ICMP_UNREACH_SRCFAIL !S !S !S !S ICMP_UNREACH_NET_UNKNOWN !<%d> !U !<%d> !U ICMP_UNREACH_HOST_UNKNOWN !<%d> !U !<%d> !W ICMP_UNREACH_ISOLATED !<%d> !I !I !I ICMP_UNREACH_NET_PROHIB !<%d> !A !A !A ICMP_UNREACH_HOST_PROHIB !<%d> !C !C !Z ICMP_UNREACH_TOSNET !<%d> !T !T !Q ICMP_UNREACH_TOSHOST !<%d> !T !T !T ICMP_UNREACH_FILTER_PROHIB !X !A !A !X ICMP_UNREACH_HOST_PRECEDENCE !V !<%d> !V !V ICMP_UNREACH_PRECEDENCE_CUTOFF !C !<%d> !C !C Graham Wilson is planning to use the same codes in Debian's version. MFC after: 3 weeks
* Option for setting a fixed destination port. This is useful for tracingcjc2006-05-111-8/+15
| | | | | | | | | to a host behind a firewall where only specific services are allowed. For example, to trace the hops to an HTTP server behind a firewall, $ traceroute -e -P tcp -p 80 www-firewalled.example.com MFC after: 1 week
* - Update pretty print of multipath routes to better handle timeout of firstpav2006-01-101-1/+1
| | | | | | | | | | | | | | | | probe Before: 5 * freebsd (195.250.137.134) 19.086 ms 24.694 ms After: 5 * freebsd (195.250.137.134) 19.086 ms 24.694 ms Fixes: bin/90098 Reported by: Jeremy Chadwick <freebsd@jdc.parodius.com> Approved by: andre MFC after: 1 day
* Pretty print multipath routes.andre2005-08-261-0/+1
| | | | | | | | | | | | | | | | | | | Before (backslash in c syntax meaning): 6 p16-2-0-0.r21.sttlwa01.us.bb.verio.net (129.250.2.180) 71.027 ms \ p16-1-1-3.r20.sttlwa01.us.bb.verio.net (129.250.2.6) 66.730 ms 66.535 ms 7 xe-0-2-0.r20.sttlwa01.us.bb.verio.net (129.250.4.16) 71.092 ms \ xe-3-1.r00.sttlwa01.us.bb.verio.net (129.250.2.205) 66.598 ms \ xe-0-2-0.r20.sttlwa01.us.bb.verio.net (129.250.4.16) 71.024 ms After: 6 p16-2-0-0.r21.sttlwa01.us.bb.verio.net (129.250.2.180) 71.027 ms p16-1-1-3.r20.sttlwa01.us.bb.verio.net (129.250.2.6) 66.730 ms 66.535 ms 7 xe-0-2-0.r20.sttlwa01.us.bb.verio.net (129.250.4.16) 71.092 ms xe-3-1.r00.sttlwa01.us.bb.verio.net (129.250.2.205) 66.598 ms xe-0-2-0.r20.sttlwa01.us.bb.verio.net (129.250.4.16) 71.024 ms Submitted by: Richard A Steenbergen <ras at e-gerbil.net> MFC after: 3 days
* Check -s option source address for validity.pb2004-04-171-2/+2
| | | | | PR: bin/29026 MFC after: 1 week
* Fix traceroute where [number of hops] * [number of packets per hop] > 255.cperciva2004-01-231-2/+2
| | | | | | PR: misc/61336 Submitted by: Mike Hibler <mike@cs.utah.edu> Approved by: rwatson (mentor)
* Calculate checksums correctly when LSRR is in effect by passing thefenner2002-07-281-24/+36
| | | | | | | IP header and protocol header seperately. Also calculate TCP checksums. Submitted by: orion
* Merge 1.4a12fenner2002-07-281-198/+509
|
* s/ifdef/ifndef/.dcs2002-07-231-1/+1
| | | | Fenner got this inverted through a misunderstanding between us.
* Add an ICMP protocol handler, partly based on LBL's traceroute 1.4 .fenner2002-07-221-3/+56
| | | | Submitted by: dcs
* Actually use gen_prep() and gen_check(), instead of udp_prep() andfenner2002-07-221-3/+3
| | | | udp_check(), for unknown protocols.
* Allocate and clear the correct number of bytes for arobert2002-06-231-2/+2
| | | | | | | | | struct fd_set that should be able to hold sock + 1 bits. Before, it was apparently assumed that an fd_mask has the same size as type char. PR: bin/39617 Reported by: Peter N Lewis <peter@stairways.com.au>
* Fetch the default maximum TTL value from the net.inet.ip.ttl MIB.ru2001-06-061-6/+21
| | | | | PR: bin/19598 MFC after: 1 week
* Defining usage() "__dead" is just ridiculous. It also won't compile withobrien2000-10-271-2/+2
| | | | | | a June 2000 GCC 2.96 snapshot. Reviewed by: bde
* Don't write past the end of our fd_setkris2000-10-081-4/+9
| | | | Obtained from: OpenBSD, via KAME
* Format string paranoia.kris2000-10-081-5/+5
|
* Document the -S flag (added in rev. 1.4) in the usage() function.ghelmer2000-07-071-1/+1
| | | | | PR: bin/18153 Prompted by: Nathan Ahlstrom <nrahlstr@winternet.com>
* Correct FreeBSD id place. Also correct vendor rcsid.shin2000-03-301-3/+5
| | | | | | Specified by: bde Reviewed by: bde
* Bypass IPsec for traceroute invoked by root.shin2000-03-301-1/+49
| | | | | PR: bin/17606 Submitted by: Louis Mamakos <louie@TransSys.COM
* Fix bug (introduced by me) where UDP port numbers were starting at 1 insteadarchie1999-06-251-3/+7
| | | | | | of 33435 like before. Reported by: John Polstra <jdp@polstra.com>
* Add a min TTL flag to go along with the max TTL flag. That is, this flagarchie1999-05-121-9/+25
| | | | | | allows you to start tracing at a hop number other than 1. Submitted by: Stefan `Sec` Zehl <sec@42.org>
* Add the capability for traceroute(8) to send packets of any IP protocolarchie1999-05-061-32/+215
| | | | | | | instead of just UDP; an alternate protocol is specified by '-P proto'. This is useful for finding routers that are blocking packets based on IP protocol. New handlers can be added fairly easily to do protocol- specific things.
* Better fix for the traceroute flood bug.des1999-02-161-7/+16
| | | | Submitted by: bde
* If the user provided a large enough argument to the -w option, the sumdes1999-02-151-1/+3
| | | | would overflow and you'd end up doing select() with a negative timeout.
* Fix an alignment problem on alpha by doing a bytewise copy.jb1998-06-061-2/+4
|
* Fix a typo. Oops.sef1996-10-081-2/+2
| | | | Submitted by: asami
* Paul objected to my previous change. This adds the same functionalitysef1996-10-081-3/+9
| | | | | | | | | | | | (implemented better, admittedly) with a new option, '-S'. If the maintainers of traceroute (Van?) add a -S option, we will then be in conflict. Also added a too-brief description of the option in the man page. Someone with a better command of English than I at the moment should probably look over it and rephrase it. Reviewed by: pst, jkh
* Print out a summary of the loss percentages for each hop. No manual changessef1996-10-051-3/+7
| | | | | | just yet, I know, evil of me. Reviewed by: jkh
* Add FreeBSD modificationsfenner1996-09-301-9/+38
| | | | | - Move setuid(getuid()) much earlier - Add "SANE_PRECISION" time printing code
* Virgin import of LBL traceroute version 1.3.2.fenner1996-09-301-0/+977
Obtained from: ftp://ftp.ee.lbl.gov/traceroute.tar.Z on 30-Sep-1996.
OpenPOWER on IntegriCloud