]> git.gsnw.org Git - fping.git/commit
fix ICMPv6 error message handling and reporting
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sun, 4 May 2025 15:44:29 +0000 (17:44 +0200)
committerErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sun, 13 Jul 2025 13:42:00 +0000 (15:42 +0200)
commit6a678655be7488b8dcb3bfb7feb2af8a26293a1a
treecf21bb3fb2fa5cde2d5fc5c1eab60a56e3f5824e
parent94160e54b32c5ac1f51937c8df42e5458beaf36f
fix ICMPv6 error message handling and reporting

Handling of received ICMPv6 messages different from Echo Reply
was based on IPv4 code.  It would thus use a too small minimum
size, and interpret the wrong data as ICMPv6 fields.  Thus
received ICMPv6 error messages were either not reported at all,
or were reported incorrectly.

This commit introduces the following changes to fix this and thus
address GitHub issue #390:

- Filter out irrelevant ICMPv6 messages: fping needs to receive
  ICMPv6 Echo Reply and ICMPv6 error messages, nothing else
  (only relevant for raw sockets).
- Fix offset calculation to look at the included packet that
  caused this ICMPv6 error message.
- Ignore invoking packets that do not have ICMPv6 as the first
  IPv6 Next Header in the packet (there could be, e.g., IPv6
  Extension Headers).
- Fix ICMPv6 message type determination, and print respective
  warning messages.
CHANGELOG.md
configure.ac
src/fping.c
src/socket6.c