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 errno. #504

Closed
wants to merge 0 commits into from
Closed

Handle EHOSTDOWN errno. #504

wants to merge 0 commits into from

Conversation

arekm
Copy link
Contributor

@arekm arekm commented Mar 4, 2024

Handle EHOSTDOWN which occurs on MacOS and causes:

% mtr 192.168.68.2
mtr: Unexpected mtr-packet error

for unreachable host.

@rewolff
Copy link
Collaborator

rewolff commented Mar 4, 2024

The code snippet around your added line seems to collapse multiple error codes down to just one Your added line "joins the crowd".

I personally strongly dislike this collapsing of error codes. It would be very much appreciated if you figure out where the further processing of these error messages from mtr-packet happen and then add new error codes there as well...

@arekm
Copy link
Contributor Author

arekm commented Mar 4, 2024

Did that way because existing code does it already

 } else if (errno == ENETUNREACH) {
        printf("%d no-route\n", command_token);
    } else if (errno == EHOSTUNREACH) {
        printf("%d no-route\n", command_token);

and EHOSTDOWN fits in that.

These would also need to be split.

@rewolff
Copy link
Collaborator

rewolff commented Mar 4, 2024

Correct!
So since you're already "working on that code" I'd appreciate the help if you could "improve" it further by splitting it now. Maybe add a comment that I don't want error codes collapsed in the future.

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