aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/traceroute
Commit message (Collapse)AuthorAgeFilesLines
* traceroute: graceful recover after networking errors with as_serverEugene Grosbein2026-02-093-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currentlu, the traceroute[6] utility does not check for possible networking errors while talking to as_server in case of "traceroute -a". Meantime, there is a common case when trace is long and it has many non-responding hops (shown as '* * *'), so as_server aborts our connection, hence no AS numbers shown for the rest of trace. Somewhat artifical way to reproduce the problem: traceroute to 57.144.244.1 (57.144.244.1), 80 hops max, 48 byte packets 5 [AS174] be2950.ccr42.fra05.atlas.cogentco.com (154.54.72.42) 74.277 ms 9.605 ms 9.599 ms 6 [AS174] 149.11.228.19 (149.11.228.19) 9.506 ms 9.466 ms 9.420 ms 7 [AS33182] po172.asw02.fra5.tfbnw.net (129.134.108.146) 9.725 ms 9.874 ms 9.696 ms 8 [AS32934] psw04.fra5.tfbnw.net (157.240.59.85) 8.718 ms 8.691 ms 8.618 ms 9 * * * 10 [AS0] edge-star-mini-shv-01-fra5.facebook.com (57.144.244.1) 9.747 ms 9.815 ms 9.699 ms Note what due to increased timeout (-w10) we get [AS0] for 10th hop because as_server closed our connection. Same problem occurs with default -w3 when there are lots of '* * *' hops in a trace. Fix it with some additional error checking and a reconnection. This patch was in my use for many years and after traceroute(8) moved from contrib/ to usr.sbin/ it's nice to have it in the tree. MFC after: 2 weeks
* SPDX: Tag BSD-4.3TAHOEAlexander Ziaee2025-05-211-0/+3
| | | | | | | | | | | | | | TIL traceroute.8 has one of the oldest liceses, predating BSD-4-Clause! The SPDX tag was not even on Wikipedia. These are all the files I could find in the tree with git grep that look like the license reported on the SPDX website, including one that was misfiled. Ref: https://spdx.org/licenses/BSD-4.3TAHOE.html MFC after: 3 days Reported by: brooks Reviewed by: brooks, carlavilla, imp, ivy Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D50362
* traceroute tests: fix the test when SCTP is supportedLexi Winter2025-05-161-6/+0
| | | | | | | | | | | | | | | | The SCTP test assumes a default system configuration where SCTP is not supported, so the probe packet returns an ICMP error which is displayed as a !P response. If SCTP is supported, then something else is returned instead (depending on exactly what probe we sent, but not an ICMP error) and the test fails. Since we already check the correct probes are sent using tcpdump, remove the match for the second hop entirely. Reported by: Jenkins Reviewed by: des Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50336
* traceroute.8: improve the documentation of -PLexi Winter2025-05-151-5/+57
| | | | | | | | | | | 1. -P didn't say what the argument is supposed to be; in the case of udplite(4), "-Pudp-lite" is not valid, one must use "-Pudplite". 2. be more explicit about what sort of packets we generate, particularly for -Psctp and -Pgre. Reviewed by: imp, tuexen, des Approved by: des (mentor) Pull Request: https://github.com/freebsd/freebsd-src/pull/1657
* traceroute: add testsLexi Winter2025-05-053-0/+890
| | | | | | | | | | | | | | | | | | add some basic tests for traceroute. this covers most of the flags we can easily test; in some cases we use tcpdump to ensure the correct packets are actually being sent. to run the tests, we create three jails: one for the source host, one for the destination host, and one to route packets betweem them. this ensures we're actually testing traceroute across a routed network and not just sending probe packets to a directly connected host. no tests for traceroute6 are in this commit since the traceroute6 merge into traceroute is in progress elsewhere. Reviewed by: des, adrian Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D49838
* tcp: extend the use of the th_flags accessor functionRichard Scheffenegger2024-11-291-1/+1
| | | | | | | | | | | Formally, there are 12 bits for TCP header flags. Use the accessor functions in more (kernel) places. No functional change. Reviewed By: cc, #transport, cy, glebius, #iflib, kbowling Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D47063
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* traceroute: remove rcsid tagsLexi Winter2024-02-083-20/+0
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1100
* traceroute: remove configuration #definesLexi Winter2024-02-084-111/+0
| | | | | | | | | traceroute used a series of #defines to specify what features are available on the host platform. As traceroute is now in source, these are unnecessary and complicate the code, so remove them. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1100
* traceroute: move from contrib to usr.sbinLexi Winter2024-02-0810-13/+3284
| | | | | | | | | | traceroute hasn't had a vendor import since 2002, while since then it's had several significant FreeBSD-specific commits. Since it's unlikely another vendor import will happen, and to make the merge of traceroute6 into traceroute easier, import traceroute into usr.sbin. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1100
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-3/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+8
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* pkgbase: Put a lot of binaries and lib in FreeBSD-runtimeEmmanuel Vadot2019-09-051-0/+1
| | | | | | | | | | | | All of them are needed to be able to boot to single user and be able to repair a existing FreeBSD installation so put them directly into FreeBSD-runtime. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21503 Notes: svn path=/head/; revision=351855
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* We use a few different ifdef's names to check if we are using Casper or not,Mariusz Zaborski2017-09-211-1/+1
| | | | | | | | | | let's standardize this. Now we are always use WITH_CASPER name. Discussed with: emaste@ MFC after: 1 month Notes: svn path=/head/; revision=323866
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+4
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Use SRCTOP-relative paths to other directories instead of .CURDIR-relative onesEnji Cooper2017-03-011-1/+1
| | | | | | | | | | This simplifies pathing in make/displayed output. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314459
* Capsicumize traceroute.Mariusz Zaborski2017-02-201-0/+8
| | | | | | | | | | PR: 193973 Submitted by: Mikhail <mp39590@gmail.com> Reviewed by: pjd, bapt, emaste, AllanJude Differential Revision: https://reviews.freebsd.org/D9303 Notes: svn path=/head/; revision=314000
* DIRDEPS_BUILD: Regenerate without local dependencies.Bryan Drewery2016-02-241-2/+0
| | | | | | | | | | | These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295989
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-1/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+23
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |/ |/| | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275054
* | Make SOCK_RAW sockets to be truly raw, not modifying received and sentGleb Smirnoff2014-09-011-1/+1
|/ | | | | | | | | | | | | | | | | packets at all. Swapping byte order on SOCK_RAW was actually a bug, an artifact from the BSD network stack, that used to convert a packet to native byte order once it is received by kernel. Other operating systems didn't follow this, and later other BSD descendants fixed this, leaving us alone with the bug. Now it is clear that we should fix the bug. In collaboration with: Olivier Cochard-Labbé <olivier cochard.me> See also: https://wiki.freebsd.org/SOCK_RAW Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270929
* traceroute(8): make WARNS=3 cleanUlrich Spörlein2010-12-041-1/+1
| | | | | | | Also fixes an operator precedence bug for TCP tracerouting Notes: svn path=/head/; revision=216184
* Remove unused traceroute(8) contrib code from headUlrich Spörlein2010-11-271-1/+1
| | | | | | | It still lives on under vendor/traceroute. Notes: svn path=/head/; revision=215937
* Correct spelling.Bjoern A. Zeeb2010-01-091-1/+1
| | | | | | | | | Submitted by: (pluknet gmail.com) MFC after: 4 days X-MFC with: r201806 Notes: svn path=/head/; revision=201897
* Switch traceroute over to make use of proper in-kernel sourceBjoern A. Zeeb2010-01-082-2/+96
| | | | | | | | | | | | | address selection. Reviewed by: rwatson, fenner MFC after: 1 week X-MFCable to: stable/8, stable/7 (after r183571). PR: kern/139454 Tested by: Frank Steinborn (steinex nognu.de) Notes: svn path=/head/; revision=201806
* The last big commit: let usr.sbin/ use WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | Notes: svn path=/head/; revision=201390
* Add AS lookup functionality. On each hop we query a whois server toRui Paulo2008-02-201-1/+1
| | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=176428
* Remove alpha left-overs.Ruslan Ermilov2006-08-221-5/+0
| | | | Notes: svn path=/head/; revision=161526
* NOIPSEC -> TRACEROUTE_NO_IPSECRuslan Ermilov2004-12-211-2/+2
| | | | Notes: svn path=/head/; revision=139125
* Update for traceroute 1.4a12Bill Fenner2002-07-281-3/+6
| | | | Notes: svn path=/head/; revision=100788
* Add '+FreeBSD' to the version string, to reflect that this programBill Fenner2002-07-231-1/+2
| | | | | | | | bears little relationship to the one from LBL with the same name and version number. Notes: svn path=/head/; revision=100540
* Set BINOWN=root explicitly for setuid root binaries.Ruslan Ermilov2001-09-131-0/+1
| | | | | | | | | This is not "useless", as one may have non-default setting for BINOWN in make.conf, and we still want these to be installed setuid root in this case. Notes: svn path=/head/; revision=83391
* Perform a major cleanup of the usr.sbin Makefiles.David E. O'Brien2001-07-201-13/+15
| | | | | | | | These are not perfectly in agreement with each other style-wise, but they are orders of orders of magnitude more consistent style-wise than before. Notes: svn path=/head/; revision=80029
* Fetch the default maximum TTL value from the net.inet.ip.ttl MIB.Ruslan Ermilov2001-06-061-1/+2
| | | | | | | | PR: bin/19598 MFC after: 1 week Notes: svn path=/head/; revision=77816
* - Backout botched attempt to introduce MANSECT feature.Ruslan Ermilov2001-03-261-0/+1
| | | | | | | - MAN[1-9] -> MAN. Notes: svn path=/head/; revision=74816
* Set the default manual section for usr.sbin/ to 8.Ruslan Ermilov2001-03-201-1/+0
| | | | Notes: svn path=/head/; revision=74532