Skip to content

Improve socket function replacement subsystem#894

Merged
bradh352 merged 18 commits intoc-ares:mainfrom
bradh352:sock_functions
Oct 8, 2024
Merged

Improve socket function replacement subsystem#894
bradh352 merged 18 commits intoc-ares:mainfrom
bradh352:sock_functions

Conversation

@bradh352
Copy link
Member

@bradh352 bradh352 commented Oct 8, 2024

Some external users swap out the entire IP stack, such as Seastar that uses DPDK. So we need to allow them to override all network stack functions used by c-ares. Since we don't know what network functions may be needed in the future, we need to make a versioned structure that can be expanded. We'll need to disable any features in the future if the versioned interface is less than is required to support any new features.

We recently had a regression when we added DNS Cookie support as we relied on getsockname() to get the local source ip address, but we were calling the native version since there was no registered callback available. We will mark this as optional and just skip this step in DNS Cookie invalidation if its not available for the legacy api users.

Supersedes #893
Authored-By: Brad House (@bradh352)

@bradh352
Copy link
Member Author

bradh352 commented Oct 8, 2024

still need to update manpages, and work with seastar to ensure there is nothing else that needs to be extended

@tchaikov
Copy link
Contributor

tchaikov commented Oct 8, 2024

still need to update manpages, and work with seastar to ensure there is nothing else that needs to be extended

thank you Brad! please ping me once this PR is ready for test. i will build seastar with your change and test it.

@bradh352
Copy link
Member Author

bradh352 commented Oct 8, 2024

@tchaikov Other than updating the manpages, I think the code itself is done. I added if_nametoindex() and if_indextoname() as external network functions that can be specified in the new api.

That said, even without changing anything in your existing integration, it should fix the regression from 1.33.0.

@bradh352 bradh352 merged commit 0274543 into c-ares:main Oct 8, 2024
@bradh352 bradh352 deleted the sock_functions branch October 9, 2024 23:32
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