aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/traceroute6
Commit message (Collapse)AuthorAgeFilesLines
* traceroute: graceful recover after networking errors with as_serverEugene Grosbein5 days1-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* traceroute6(8): Stop probing on networks rejected.Juraj Lutter2025-06-082-2/+8
| | | | | | | | | | | | | Stop probing after receiving ICMP6_DST_UNREACH and print ICMP6 error code. The behavior can be observed by tracing the route to, for example, 2a02:ee80:4028:1126:: Discussed with: Job Snijders, Nick Hilliard Obtained from: OpenBSD Reviewed by: markj, jlduran Differential Revision: https://reviews.freebsd.org/D47520
* 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
* traceroute6: Update .PATH and include path after traceroute movedMark Johnston2024-02-081-1/+1
| | | | Fixes: 9b7a920a12a9 ("traceroute: move from contrib to usr.sbin")
* traceroute: Lint manualsJose Luis Duran2024-02-031-24/+22
| | | | | | | | Fix a number of warning mandoc -Tlint and igor turned up. No changes intended. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/901
* traceroute: Standardize usageJose Luis Duran2024-02-032-7/+6
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/901
* traceroute: Update values in examplesJose Luis Duran2024-02-031-6/+6
| | | | | | | | Standardize the documentation and update it to reflect the current values. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/901
* traceroute6: remove -l flagLexi Winter2024-02-022-14/+3
| | | | | | | | | | | | The -l flag was used to tell traceroute6(8) to show both hostname and address for each hop. However, traceroute(8) already does this by default, and there's no reason for traceroute6 to behave differently. Make this the default behaviour, and accept -l for backward compatibility as a no-op flag. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1023
* traceroute6: Implement ECN bleaching detectionJose Luis Duran2024-01-032-8/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicit Congestion Notification (ECN) is a mechanism that allows end-to-end notification of network congestion without dropping packets by explicitly setting the ECN code point (2 bits). Per RFC 8087, section 3.5, network devices should not be configured to change the ECN code point in the packets that they forward, except to set the CE (Congestion Experienced) code point ('11') to signal incipient congestion. The current commit adds an -E flag to traceroute6 that crafts a packet with an ECT(1) code point ('01'). If the packet is received back with a zero ECN code point ('00'), it outputs that the hop in question erases or "bleaches" the ECN code point values. Bleaching may occur for various reasons (including normalizing packets to hide which equipment supports ECN). This policy prevents the use of ECN by applications. If the packet is received back with an all-ones ECN code point ('11'), it outputs that the hop in question is experiencing "congestion". If the packet is received back with a different ECN code point ('10'), it outputs that the hop in question changes or "mangles" the ECN code point values. If the packet is received with the same ECN code point that was sent ('01'), it outputs that the hop has "passed" the ECN bits appropriately. Inspired by: Darwin Reviewed by: imp, markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/879
* traceroute6: style(9) fixesJose Luis Duran2024-01-031-19/+18
| | | | | | | | No functional change intended. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-9/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.sbin: Remove ancient SCCS tags.Warner Losh2023-11-271-3/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-251-2/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+3
|
* traceroute6: fix capabilities for the rcv socketMichael Tuexen2022-10-041-2/+3
| | | | | | | | | | | | On the receive socket, recvmsg() and poll()/select() is called. Therefore, CAP_EVENT is needed in addition to CAP_RECV.. While there, check the socket for readbility before calling recvmsg(). Reviewed by: markj@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D36878
* traceroute6: Properly calculate UDP checksumZhenlei Huang2021-05-031-0/+1
| | | | | | | | | | | | | | | The revision D25604 capsicumize traceroute6. For UDP the send socket was changed from SOCK_DGRAM to SOCK_RAW and thus the UDP checksum need be calculated by application itself other than the kernel. outpacket is filled with zeros by line 707, thus the first round the UDP checksum is correct. But subsequent rounds outudp->uh_sum will be left with garbage. PR: 255507 Reviewed by: ae, markj, tuexen MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30042
* traceroute6: Fix Capsicum rights for rcvsockMark Johnston2021-04-011-3/+6
| | | | | | | | | | | | | | | - Always use distinct sockets for send and recv - Limit rights on the recv socket For ICMP6 we were using the same socket for both send and receive, and we limited rights on the socket such that it's impossible to receive anything. PR: 254623 Diagnosed by: Zhenlei Huang <zlei.huang@gmail.com> Reviewed by: oshogbo MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29523
* ping: fix some man pages and tests after r368045Alan Somers2020-11-261-2/+1
| | | | | | | MFC-with: r368045 Notes: svn path=/head/; revision=368046
* [traceroute6] Don't do the casper bits when we're not doing casperAdrian Chadd2020-10-141-1/+3
| | | | | | | | | | | | | | | | | | This with the previous patch I committed makes traceroute6/traceroute compile fine when libcasper isn't enabled. This complains strongly with unused variables and such when compiled with gcc-6 on mips32. Tested: * compiled/run on mips32 hardware (AR9344) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26773 Notes: svn path=/head/; revision=366690
* Fix a few mandoc issuesGordon Bergling2020-10-091-2/+4
| | | | | | | | | | | - no blank before trailing delimiter - whitespace at end of input line - sections out of conventional order - normalizing date format - AUTHORS section without An macro Notes: svn path=/head/; revision=366572
* Add a -t option to traceroute6 to control the traffic class used whenMichael Tuexen2020-09-132-3/+32
| | | | | | | | | | | | sending probe packets. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26410 Notes: svn path=/head/; revision=365685
* Fix the length of probe packets when using UDP.Michael Tuexen2020-09-121-2/+0
| | | | | | | | | Since https://svnweb.freebsd.org/changeset/base/365378 a raw socket is used for sending UDP probe packets instead of a UDP socket. So don't compensate for the UDP header anymore. Notes: svn path=/head/; revision=365658
* Simplify code, no functional change.Michael Tuexen2020-09-121-6/+1
| | | | | | | | | Since https://svnweb.freebsd.org/base?view=revision&revision=365378 UDP is handled the same way as SCTP and TCP (using a raw socket). Therefore use the same code path. Notes: svn path=/head/; revision=365657
* Remove duplicated line.Mariusz Zaborski2020-09-061-2/+0
| | | | | | | Reported by: lwhsu Notes: svn path=/head/; revision=365382
* traceroute6: capsicumize itMariusz Zaborski2020-09-062-24/+122
| | | | | | | | | Submitted by: Shubh Gupta <shubh@freebsd.org> Sponsored by: Google (GSOC 2020) Differential Revision: https://reviews.freebsd.org/D25604 Notes: svn path=/head/; revision=365378
* traceroute6: Fix most warnings at the default WARNS level.Mark Johnston2020-07-212-61/+52
| | | | | | | | | | | | | | Fix some style issues as well. Leave -Wno-cast-aligned set for now, as most of the warnings come casts of CMSG_DATA(), which does provide sufficient alignment in practice. Submitted by: Shubh Gupta <shubh@freebsd.org> Sponsored by: Google (GSOC 2020) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25603 Notes: svn path=/head/; revision=363395
* 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
* Remove the USE_RFC2292BIS option and reap dead codeAlan Somers2019-07-222-22/+1
| | | | | | | | | | | | | This option was imported as part of the KAME project in r62627 (in 2000). It was turned on unconditionally in r121472 (in 2003) and has been on ever since. The old alternative code has bitrotted. Reap the dead code. Reported by: Ján Sučan <jansucan@gmail.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20938 Notes: svn path=/head/; revision=350225
* Add support for ICMPv6 messages indicating a parameter problem relatedMichael Tuexen2019-07-162-2/+10
| | | | | | | | | to an unrecognized next header. MFC after: 2 weeks Notes: svn path=/head/; revision=350028
* Let packet_op() explicitly return the type and code instead of doingMichael Tuexen2019-07-161-44/+46
| | | | | | | | | | | | | | this implicitly by encoding it in a number space. No functional change intended. This is done as a preparation to add support for ICMPv6 mesages indicating a parameter problem related to the next header. MFC after: 2 weeks Notes: svn path=/head/; revision=350027
* Whitespace change. No functional change.Michael Tuexen2019-07-161-14/+14
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=350026
* Fix in the documentation that the default hop limit is not 30, butMichael Tuexen2018-05-021-2/+5
| | | | | | | | | | | | | | | | | the value of the sysctl variable net.inet6.ip6.hlim. This is true since https://svnweb.freebsd.org/base?view=revision&revision=122574 The default of 30 (which was correct up to r122574) was incorrectly documented in https://svnweb.freebsd.org/base?view=revision&revision=130268 Thanks to Timo Voelker for makeing me aware of the inconsistency between to code and the documentation. MFC after: 3 days Notes: svn path=/head/; revision=333176
* When using SCTP for sending probe packets, use INIT chunks for payloadsMichael Tuexen2018-01-272-21/+98
| | | | | | | | | | | | larger than or equal to 32 bytes. For smaller probe packets, keep using SHUTDOWN-ACK chunks, possibly bundled with a PAD chunk. Packets with INIT chunks more likely pass through firewalls. Therefore, use them when possible. MFC after: 1 week Notes: svn path=/head/; revision=328488
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Fix reporting of probing size. This bug was introduced in r324119.Michael Tuexen2017-09-301-1/+2
| | | | | | | MFC after: 4 weeks Notes: svn path=/head/; revision=324122
* Add SCTP and TCP as protocols for sending probe packets.Michael Tuexen2017-09-302-8/+244
| | | | | | | MFC after: 4 weeks Notes: svn path=/head/; revision=324120
* * Update function definitions.Michael Tuexen2017-09-302-75/+39
| | | | | | | | | | | | | | | | | * Ensure that the datalen always describes the length after the IPv6 header consistently, not matter which protocol us used for probes.. * Document that the default length is 20, not 12. * Don't send inormation in probe packets which is not needed or even checked when the responses are processed. * Address CID 978587. This is mainly a cleanup preparing the addition of SCTP and TCP as possible probe packet protocols. MFC after: 4 weeks Notes: svn path=/head/; revision=324119
* 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
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Fix an infinite loop at an non-responding hop when other echo repliesHiroki Sato2016-11-051-0/+3
| | | | | | | | | | | are kept arriving in the waittime time window. Submitted by: Denny Page PR: 210286 MFC after: 3 days Notes: svn path=/head/; revision=308347
* traceroute6(8): use NULL instead of zero for initializing a pointer.Pedro F. Giffuni2016-05-121-1/+1
| | | | Notes: svn path=/head/; revision=299501
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * 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