Skip to content

docs: ares_set_local_ip4() byte order - #368

Merged
bradh352 merged 1 commit into
c-ares:masterfrom
dlundquist:ares_set_local_ip4_docs
Nov 5, 2020
Merged

docs: ares_set_local_ip4() byte order#368
bradh352 merged 1 commit into
c-ares:masterfrom
dlundquist:ares_set_local_ip4_docs

Conversation

@dlundquist

Copy link
Copy Markdown
Contributor

Signed-off-by: Dustin Lundquist d.lundquist@tempered.io

Signed-off-by: Dustin Lundquist <d.lundquist@tempered.io>
@bradh352

bradh352 commented Nov 4, 2020

Copy link
Copy Markdown
Member

i haven't checked, but is one really host byte order and the other network byte order?

@dlundquist

dlundquist commented Nov 4, 2020

Copy link
Copy Markdown
Contributor Author

@bradh352 yes, the IPv4 version ends up calling htonl() in configure_socket(), hence updating the documentation.

https://github.com/c-ares/c-ares/blob/master/src/lib/ares_process.c#L1023

@bradh352

bradh352 commented Nov 4, 2020

Copy link
Copy Markdown
Member

yikes, hmm ... the docs for these aren't even up on https://c-ares.haxx.se/

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 88.625% when pulling e9814b2 on dlundquist:ares_set_local_ip4_docs into c15f403 on c-ares:master.

@bradh352

bradh352 commented Nov 4, 2020

Copy link
Copy Markdown
Member

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).

@bagder

bagder commented Nov 5, 2020

Copy link
Copy Markdown
Member

(I fixed the omission and minor docs breakage on the website)

I'd really love to break API/ABI compatibility to fix this one since its really braindead

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.

@bagder bagder left a comment

Copy link
Copy Markdown
Member

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.

@bradh352

bradh352 commented Nov 5, 2020

Copy link
Copy Markdown
Member

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.

@bradh352
bradh352 merged commit 3d4e80b into c-ares:master Nov 5, 2020
@dlundquist
dlundquist deleted the ares_set_local_ip4_docs branch March 24, 2021 16:50
sergepetrenko pushed a commit to tarantool/c-ares that referenced this pull request Jul 29, 2022
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>
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.

4 participants