8000 Improve socket function replacement subsystem by bradh352 · Pull Request #894 · c-ares/c-ares · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve socket function replacement subsystem #894

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

Merged
merged 18 commits into from
Oct 8, 2024

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
25 of 29 checks passed
@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
0