Re: merge traceroute6 into traceroute

From: Lexi Winter <lexi_at_hemlock.eden.le-fay.org>
Date: Thu, 17 Apr 2025 22:44:24 UTC
Dag-Erling Smørgrav:
> Lexi Winter <lexi@hemlock.eden.le-fay.org> writes:
> > i have proposed a patch to merge traceroute6 into traceroute, so that
> > traceroute supports both IPv4 and IPv6 addresses:
> >
> > https://github.com/freebsd/freebsd-src/pull/1647
> 
> I've only skimmed the PR but I urge you to look at sbin/ping/main.c and
> adjust your code to match.

i think you're essentially proposing what jlduran@ already proposed in
the PR.  this approach is not wrong but i dislike it, because it leaves
a lot of duplicate code between the IPv4 and IPv6 versions.  for
example, nearly all command-line arguments are (or should be) common
between IPv4 and IPv6 and there should be a common implementation of
those to avoid code duplication.  the basic mechanics of sending packets
and receiving responses should be common between both versions, as
should handling of -P, etc., etc.

the point i made on the PR was that if you take jlduran's version and
then improve it to how it could be done better, you basically end up
with my version.  not to say my version is perfect (it certainly is not)
but it's further along the path to what we eventually want to end up
with.

does that make sense?