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

Handle EHOSTDOWN and refine error handling better granularity #513

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

arekm
Copy link
Contributor

@arekm arekm commented Aug 21, 2024

Handle EHOSTDOWN which occurs on MacOS and causes:

% mtr 192.168.68.2
mtr: Unexpected mtr-packet error

for unreachable host and also split error handling better granularity.

@arekm
Copy link
Contributor Author

arekm commented Aug 21, 2024

That's continuation of #504

@arekm
Copy link
Contributor Author

arekm commented Aug 21, 2024

There is one thing there:

} else if (icmp_type == ICMP_DEST_UNREACH) {
-        result = "no-route";
+        /* XXX icmphdr->code is not known here, so assume that host is unreachable */
+        result = "no-route-host";

accessing icmphdr->code for ipv4 is possible but requires a bit of changes and not sure if it's worth the hassle.

Also ipv6 has no host vs network unreachable differentiation as I see it:
https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml#icmpv6-parameters-3

@rewolff rewolff merged commit aad45da into traviscross:master Aug 21, 2024
2 checks passed
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.

2 participants