Skip to content

Conversation

devnexen
Copy link
Member

No description provided.

Comment on lines 657 to 661
if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
RETURN_STRING(str);
} else {
RETURN_FALSE;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can this actually fail? because otherwise the call to this in dns.c looks fishy?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would need to recheck some of them indeed.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Looking at https://man7.org/linux/man-pages/man3/inet_ntop.3.html it seems like it shouldn't be possible to hit the error conditions? So maybe just adding an assertion that we always have a value is enough, instead of handling those cases?

@devnexen
Copy link
Member Author

devnexen commented Nov 4, 2023

I admit most seem over zealous but would like to change to assertions in a later PR.

@Girgias
Copy link
Member

Girgias commented Nov 6, 2023

ACK

@devnexen devnexen closed this in 44f9c22 Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants