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

tracepath: identify interfaces when available #325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ishaangandhi
Copy link

@ishaangandhi ishaangandhi commented Apr 17, 2021

RFC 5837 extends ICMP to provide more information about the interfaces packets move through as they flow through the network.

This patch prints those extensions when available.

Signed-off-by: Ishaan Gandhi ishaangandhi@gmail.com

if (ipaddr_flag) {
if (offset + 8 > pkt_len || ntohs(*(uint16_t *)(pkt + offset)) != 1)
goto err;
printf(" address=%s;", inet_ntop(AF_INET, &pkt[offset + 4], if_addr, sizeof(if_addr)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why you're not handling AF_INET6?

Copy link
Author

Choose a reason for hiding this comment

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

Only called setsockopt with IP_RECVERR_RFC4884 not the IPv6 equivalent, so any interface returned in a well-formed packet will be IPv4.

Why not setsockopt with IPV6_RECVERR_RFC4884? I haven't had time to test it yet. It will be a relatively painless patch once I can test it.

@ishaangandhi
Copy link
Author

(For testing: this patch can be applied to Linux 5.9+)

0001-v4-icmp-support-rfc5837.patch.txt

RFC 5837 extends ICMP to provide more information about the interfaces packets move through as they flow through the network.

This patch prints those extensions when available.

Signed-off-by: Ishaan Gandhi<ishaangandhi@gmail.com>
@pevik
Copy link
Contributor

pevik commented Nov 6, 2022

@pevik pevik added enhancement requires-kernel-patch Functionality should not be merged, because it requires patch to mainline kernel. labels Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement requires-kernel-patch Functionality should not be merged, because it requires patch to mainline kernel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants