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

Always update Packet's addresses #187

Closed
wants to merge 1 commit into from
Closed

Conversation

gdetal
Copy link

@gdetal gdetal commented Nov 10, 2021

Hi,

When a ping is performed on multicast addresses, the lib currently provides the address of the original destination in the callbacks. However, in this case the reply will come from another (existing) address. It is useful to provide the actual replied address to the callback instead of the original one (see the output below).

The output of ping without this patch is:

$ sudo ping --privileged ff02::1%ens3
PING ff02::1%ens3 (ff02::1%ens3):
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.504454ms ttl=64
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.553965ms ttl=64 (DUP!)
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.580495ms ttl=64 (DUP!)
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.596156ms ttl=64 (DUP!)

And with this patch:

$ sudo ./ping --privileged ff02::1%ens3
PING ff02::1%ens3 (ff02::1%ens3):
32 bytes from fe80::546f:f0ff:fe0e:a%ens3: icmp_seq=0 time=1.256761ms ttl=64
32 bytes from fe80::546f:f0ff:fe0e:29%ens3: icmp_seq=0 time=1.396183ms ttl=64 (DUP!)
32 bytes from fe80::546f:f0ff:fe0e:8%ens3: icmp_seq=0 time=1.447454ms ttl=64 (DUP!)
32 bytes from fe80::546f:f0ff:fe0e:e%ens3: icmp_seq=0 time=1.460754ms ttl=64 (DUP!)

This is useful when one pings multicast addresses to see the actual
IPs that replied. There exist multicast addresses for both IPv4 and
IPV6 but the lib does not provide the replies address.

The output of ping without this patch is:

$ sudo ping --privileged ff02::1%ens3
PING ff02::1%ens3 (ff02::1%ens3):
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.504454ms ttl=64
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.553965ms ttl=64 (DUP!)
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.580495ms ttl=64 (DUP!)
24 bytes from ff02::1%ens3: icmp_seq=0 time=1.596156ms ttl=64 (DUP!)

And with this patch:

$ sudo ./ping --privileged ff02::1%ens3
PING ff02::1%ens3 (ff02::1%ens3):
32 bytes from fe80::546f:f0ff:fe0e:a%ens3: icmp_seq=0 time=1.256761ms ttl=64
32 bytes from fe80::546f:f0ff:fe0e:29%ens3: icmp_seq=0 time=1.396183ms ttl=64 (DUP!)
32 bytes from fe80::546f:f0ff:fe0e:8%ens3: icmp_seq=0 time=1.447454ms ttl=64 (DUP!)
32 bytes from fe80::546f:f0ff:fe0e:e%ens3: icmp_seq=0 time=1.460754ms ttl=64 (DUP!)

Which provide more useful informations.

Signed-off-by: Gregory Detal <gregory.detal@tessares.net>
@SuperQ
Copy link
Contributor

SuperQ commented Jan 21, 2023

See #226

@SuperQ SuperQ closed this Jan 21, 2023
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.

None yet

2 participants