Skip to content

Comments

fix ICMPv6 error message handling and reporting#391

Merged
auerswal merged 1 commit intoschweikert:developfrom
auerswal:icmpv6-errors
Jul 13, 2025
Merged

fix ICMPv6 error message handling and reporting#391
auerswal merged 1 commit intoschweikert:developfrom
auerswal:icmpv6-errors

Conversation

@auerswal
Copy link
Collaborator

@auerswal auerswal commented May 4, 2025

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.

@coveralls
Copy link

coveralls commented May 4, 2025

Coverage Status

coverage: 86.427% (-1.2%) from 87.577%
when pulling 228b173 on auerswal:icmpv6-errors
into 94160e5 on schweikert:develop.

@auerswal auerswal linked an issue May 4, 2025 that may be closed by this pull request
@gsnw-sebast
Copy link
Collaborator

I'm still testing

Copy link
Collaborator

@gsnw-sebast gsnw-sebast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, all standard tests are run. The code also looks good. Unfortunately, producing certain errors is not so easy.

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 schweikert#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.
@auerswal auerswal merged commit 6a67865 into schweikert:develop Jul 13, 2025
5 of 9 checks passed
@auerswal auerswal deleted the icmpv6-errors branch July 13, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing output of ICMPv6 error messages

3 participants