Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type13 tweaks #363

Merged
merged 5 commits into from
Dec 7, 2024
Merged

Type13 tweaks #363

merged 5 commits into from
Dec 7, 2024

Conversation

auerswal
Copy link
Collaborator

Some adjustments for ICMP Timestamp support. IMHO this does not need extra mention in CHANGELOG.md, maybe just add the pull request number to the line announcing ICMP Timestamp support.

Please see the individual commit messages for more information.

Initializing the timestamp variables avoids accesssing uninitialized
memory when using --icmp-timestamp with an IPv6 target.

Per RFC 792, setting the high bit indicates a non-standard value,
i.e., this is not a valid timestamp.  Thus this value can be
distinguished from valid timestamps.
When sending an ICMP Echo message, accept only an Echo Reply
message as a normal response.  When sending an ICMP Timestamp
message, accept only an ICMP Timestamp message as a normal
response.

This could matter when multiple fping processes are running
in parallel, some using Echo, others Timestamp messages.
ICMP Timestamp messages have a fixed size.  The data portion
following the ICMP header comprises 12 octets to hold three
timestamps of 4 octets each.

Giving the --icmp-timestamp option now automatically sets the
data size to 12 octets.

Error out when -b N is used together with --icmp-timestamp.

Adjust man page to mention incompatibility of -b N, --size=N
with --icmp-timestamp.  Also mention in man page that
cap_net_raw can be used instead of root privileges for ICMP
Timestamp.
The ICMP Timestamp message is defined for IPv4, but not for IPv6.

Before, combining --icmp-timestamp with an IPv6 address or a DNS
name for a dual-stacked target on a dual-stacked system resulted
in sending ICMPv6 Echo over IPv6.

Now, DNS names for dual-stacked hosts just work, i.e., fping uses
IPv4 with --icmp-timestamp.  Combining --icmp-timestamp with an
IPv6 address or an IP6-only DNS name now fails.
@coveralls
Copy link

Coverage Status

coverage: 87.627% (-0.09%) from 87.714%
when pulling 89c32f2 on auerswal:type13_tweaks
into 48e7e02 on schweikert:develop.

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.

No objections from my side. The changes are very good.

@auerswal auerswal linked an issue Dec 1, 2024 that may be closed by this pull request
@auerswal auerswal merged commit a5124e3 into schweikert:develop Dec 7, 2024
7 of 9 checks passed
@auerswal auerswal deleted the type13_tweaks branch December 7, 2024 19:04
@moeller0
Copy link

moeller0 commented Dec 9, 2024

Excellent! Looks great.

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.

FR: add local receive timestamp to --icmp-timestamp
4 participants