Commit Graph

3 Commits

Author SHA1 Message Date
Robert Scheck
a2217858ab Update incorrect FSF address 2017-08-27 00:21:47 +02:00
Matt Kimball
88d1a95087 mtr-packet: UDP probe support
Added support send using UDP as the protocol for sending probes,
rather than ICMP.  Both IPv4 and IPv6 UDP probes are supported.
We are using the source port in the UDP packet for identifying
the particular probe transmitted.  This is a bit less reliable
than ICMP, where we are also able to store our PID for verifying
the probe has been transmitted by this instance of mtr-packet,
but space is limited, and it is what the pre-existing mtr
implementation does.

We report no-route and network-down errors in response to errors
from sendto(), in addition to reporting them from errors in
the connect() used to determine the source address of an outgoing
probe.

The mtr-packet tests now properly parse the replies from
mtr-packet, as opposed to simply matching regular expressions
against the output.  This is better because it give us future
compatibility with additional reply arguments from mtr-packet.

A better introduction to mtr-packet is now included in the
mtr-packet man page.

The dual code paths for sending IPv6 probes between Linux
and non-Linux Unix-likes has been eliminated.  The Linux path
gave us direct control over the IP header, but wasn't necessary
and would make maintainence more difficult, so now Linux uses
the more indirect setsockopt() method of setting IPv6 header
fields.
2016-12-14 09:33:38 -08:00
Matt Kimball
6df4e45df4 mtr-packet: IPv6 support
mtr-packet can now send and receive ICMPv6 probes.

We now determine the source address for an outgoing probe by
opening a UDP socket to the destination, though no outgoing packets
are sent through this UDP socket.  IPv6 made this necessary, but
it now occurs for IPv4, too.

mtr-packet now uses sockaddr_storage for passing around addresses,
rather than sockaddr_in, as it can work for either IPv4 or IPv6.

To improve the maintainability of the code, the packet construction
and interpetation has been moved from probe_unix.c to construct_unix.c
and deconstruct_unix.c.

The way that Windows reads from the command stream has been changed to
avoid the possibility of hanging in a Sleep without an active read
of the command stream.

"send-probe" will now respond with "no-route" or "network-down"
when those conditions apply.

The test code has been moved to a test directory and split into
the following modules:

probe.py - tests for sending probes
cmdparse.py - tests for command parsing
mtrpacket.py - infrastructure for testing mtr-packet

The mtr-packet man page has been updated to describe ip-6 options
and now has an example of tracing a route to a remote host.

The mtr-packet network initialization has been split into two halves
to minimize the operations which occur with elevated privileges.
2016-12-09 11:14:06 -08:00