]> git.gsnw.org Git - fping.git/commit
print TOS & TTL also for IPv6 and w/o privileges
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sun, 9 Mar 2025 19:28:42 +0000 (20:28 +0100)
committerErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sat, 7 Jun 2025 18:29:05 +0000 (20:29 +0200)
commitfb6f8b5613f1bcf2a98680ef7f27f6fe8459ab1d
tree58b9a56f030628f3d1735c71c4126b7267e4ac1b
parent8ca279ec4fa474ab6465337d1647f52d2384fbe7
print TOS & TTL also for IPv6 and w/o privileges

When using IPv4 raw sockets, fping has access to the received
IP packet data including the IP header.  This allows to simply
read the TOS byte and/or TTL value from the IP header.

But, using IPv4 raw sockets requires privileges.  Additionally,
IPv6 raw sockets do not provide access to the IPv6 header.

For IPv6, or when using IPv4 datagram sockets, i.e., when fping
runs without privileges, a different method needs to be used to
access TOS / TC and TTL / Hop Count of received packets.  The
so called "control messages", also called "ancillary data", can
be used for this.  This requires several actions:

* set the respective socket options to request additional data,
* ensure the buffer used to receive additional data is sized
  large enough,
* read and process the requested additional data.
CHANGELOG.md
ci/test-04-options-a-b.pl
ci/test-08-options-n-q.pl
ci/test-11-unpriv.pl
doc/fping.pod
src/fping.c