Commit graph

99 commits

Author SHA1 Message Date
Mark Johnston 72c166696b traceroute6: Update .PATH and include path after traceroute moved
Fixes:	9b7a920a12 ("traceroute: move from contrib to usr.sbin")
2024-02-08 12:57:33 -05:00
Jose Luis Duran 5eb1aebf8d traceroute: Lint manuals
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
2024-02-02 20:14:09 -07:00
Jose Luis Duran ba09352b73 traceroute: Standardize usage
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran 00aa635337 traceroute: Update values in examples
Standardize the documentation and update it to reflect the current
values.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Lexi Winter 0a49be722f traceroute6: remove -l flag
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
2024-02-02 14:49:13 -07:00
Jose Luis Duran 0c2218d1d5 traceroute6: Implement ECN bleaching detection
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
2024-01-03 12:57:29 -05:00
Jose Luis Duran 777e494a76 traceroute6: style(9) fixes
No functional change intended.

Reviewed by:	imp, markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/879
2024-01-03 12:54:53 -05:00
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
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
2023-11-26 22:23:58 -07:00
Warner Losh 8a7b612037 usr.sbin: Remove ancient SCCS tags.
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
2023-11-26 22:23:56 -07:00
John Baldwin eba230afba Purge more stray embedded $FreeBSD$ strings
These do not use __FBSDID but instead use bare char arrays.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41957
2023-09-25 07:54:56 -07:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Michael Tuexen 8ff4fc03e6 traceroute6: fix capabilities for the rcv socket
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
2022-10-04 23:40:29 +02:00
Zhenlei Huang 1d712c0537 traceroute6: Properly calculate UDP checksum
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
2021-05-03 13:24:30 -04:00
Mark Johnston b8ae450f05 traceroute6: Fix Capsicum rights for rcvsock
- 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
2021-04-01 10:00:29 -04:00
Alan Somers 01f3f35447 ping: fix some man pages and tests after r368045
MFC-with:	r368045
2020-11-26 04:55:02 +00:00
Adrian Chadd 5c3bf25fee [traceroute6] Don't do the casper bits when we're not doing casper
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
2020-10-14 00:01:17 +00:00
Gordon Bergling 6d6d6c3603 Fix a few mandoc issues
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order
- normalizing date format
- AUTHORS section without An macro
2020-10-09 14:03:45 +00:00
Michael Tuexen c70906519a Add a -t option to traceroute6 to control the traffic class used when
sending probe packets.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D26410
2020-09-13 09:00:00 +00:00
Michael Tuexen 3303e9bc22 Fix the length of probe packets when using UDP.
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.
2020-09-12 11:24:36 +00:00
Michael Tuexen 2d0fb1b3c1 Simplify code, no functional change.
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.
2020-09-12 11:19:54 +00:00
Mariusz Zaborski 35f8045f55 Remove duplicated line.
Reported by:	lwhsu
2020-09-06 15:44:09 +00:00
Mariusz Zaborski cc432e237c traceroute6: capsicumize it
Submitted by:	Shubh Gupta <shubh@freebsd.org>
Sponsored by: Google (GSOC 2020)
Differential Revision:	https://reviews.freebsd.org/D25604
2020-09-06 14:04:02 +00:00
Mark Johnston ca19d0d78f traceroute6: Fix most warnings at the default WARNS level.
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
2020-07-21 15:03:36 +00:00
Emmanuel Vadot a7b5a3d486 pkgbase: Put a lot of binaries and lib in FreeBSD-runtime
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
2019-09-05 14:13:08 +00:00
Alan Somers af58a3c6bf Remove the USE_RFC2292BIS option and reap dead code
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
2019-07-22 20:11:33 +00:00
Michael Tuexen 1f69b3fb55 Add support for ICMPv6 messages indicating a parameter problem related
to an unrecognized next header.

MFC after:		2 weeks
2019-07-16 12:57:59 +00:00
Michael Tuexen 64694fdcc0 Let packet_op() explicitly return the type and code instead of doing
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
2019-07-16 12:38:17 +00:00
Michael Tuexen 83c022b5c0 Whitespace change. No functional change.
MFC after:		2 weeks
2019-07-16 10:06:41 +00:00
Michael Tuexen 44aaf08ba7 Fix in the documentation that the default hop limit is not 30, but
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
2018-05-02 19:36:46 +00:00
Michael Tuexen 51eff8efd9 When using SCTP for sending probe packets, use INIT chunks for payloads
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
2018-01-27 19:23:42 +00:00
Pedro F. Giffuni 8a16b7a18f General further adoption of SPDX licensing ID tags.
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.
2017-11-20 19:49:47 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Michael Tuexen d55fae0299 Fix reporting of probing size. This bug was introduced in r324119.
MFC after:	4 weeks
2017-09-30 12:30:05 +00:00
Michael Tuexen 9d8b46c89c Add SCTP and TCP as protocols for sending probe packets.
MFC after:	4 weeks
2017-09-30 11:45:33 +00:00
Michael Tuexen aa96470cc9 * Update function definitions.
* 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
2017-09-30 11:40:18 +00:00
Enji Cooper e8d2762fd3 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:17:59 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
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
2017-02-28 23:42:47 +00:00
Hiroki Sato 161ab37d24 Fix an infinite loop at an non-responding hop when other echo replies
are kept arriving in the waittime time window.

Submitted by:	Denny Page
PR:		210286
MFC after:	3 days
2016-11-05 18:00:36 +00:00
Pedro F. Giffuni ac97203f5b traceroute6(8): use NULL instead of zero for initializing a pointer. 2016-05-12 02:05:50 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
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
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00