-
Notifications
You must be signed in to change notification settings - Fork 616
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
docs: ares_set_local_ip4() byte order #368
Conversation
Signed-off-by: Dustin Lundquist <d.lundquist@tempered.io>
i haven't checked, but is one really host byte order and the other network byte order? |
@bradh352 yes, the IPv4 version ends up calling https://github.com/c-ares/c-ares/blob/master/src/lib/ares_process.c#L1023 |
yikes, hmm ... the docs for these aren't even up on https://c-ares.haxx.se/ |
looks like that was introduced about 10 years ago in e3b04e5 ... I've never seen an ipv4 address stored in little endian. @bagder ... i'd really love to break API/ABI compatibility to fix this one since its really braindead. That said, I do see curl calls this function (and of course calls ntohl() on the arg passed in). |
(I fixed the omission and minor docs breakage on the website)
I agree that it is rather braindead behavior (and quite likely I am partially to blame as I didn't spot and react about it back in the day), but if we're going to break ABI for this (and I'm not really against it) I will just insist that we bump the SONAME and do it "correctly". The question is then only if it actually is worth the friction such a thing causes as it ripples out in the world. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is how the function currently works, I think this PR should go in as-is and the discussion on what to do about it going forward is slightly independent of this fix.
heh, i'd actually vote to silently break ABI in this case :) I think API/ABI breakage is a no-go, if we were going to do that it would need to be something a lot bigger than something like this (which I doubt is used much). But yeah, you're right ... lets just document it the way it is. |
Properly document brain-dead behavior of ares_set_local_ip4() using host byte order instead of expected network byte order. Fix By: Dustin Lundquist <d.lundquist@tempered.io>
Signed-off-by: Dustin Lundquist d.lundquist@tempered.io