-S: if not valid IP addr, treat it as a device name to bind to - #212
Open
Jimmy-Z wants to merge 1 commit into
Open
-S: if not valid IP addr, treat it as a device name to bind to#212Jimmy-Z wants to merge 1 commit into
Jimmy-Z wants to merge 1 commit into
Conversation
aarond10
reviewed
Aug 10, 2026
| } else { | ||
| WLOG("Bootstrap source address '%s' is not a valid IP literal", source_addr); | ||
| // otherwise treat it as a device/interface name | ||
| ares_set_local_dev(channel, source_addr); |
Owner
There was a problem hiding this comment.
Does this work? The ares docs say:
If SO_BINDTODEVICE is not supported or the setsocktop call fails (probably because of permissions), the error is silently ignored.
main.c daemon()izes before dns_poller_init which is the caller of this function dropping root will break this and running on a non-linux system will also not work but will no longer show a warning.
Author
There was a problem hiding this comment.
I tested it without daemonizing and dropping root, it works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solves #209
basically adds a single line of code, ares already has the facility to bind device, curl side doesn't need any change since the api takes address or interface name.