-
Notifications
You must be signed in to change notification settings - Fork 7.4k
net: getaddrinfo: Query both IPv4 and IPv6 if hints is missing #16772
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
net: getaddrinfo: Query both IPv4 and IPv6 if hints is missing #16772
Conversation
Nitpick about commit message: fairly speaking, the matter should be that IPv4 and IPv6 should be both queried if hints has AF_UNSPEC address family (and that's default if hints is NULL at all). |
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.
Thanks for picking this up. To avoid future confusion when working with this func, would be nice to add one, better both, of: a) code comments; b) testcase for this behavior.
As you know, I never insist on b), though that's a perfect example where we need this... (Again, not insisting.)
7c66f8f
to
849bdf4
Compare
Updated according to comments. |
849bdf4
to
b93ef5b
Compare
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.
Thanks for the updates, looks great!
Removing platform_whitelist was a bit too brave and hits the same issue patch from @andrewboie hit earlier. Better to skip that change for now I guess.
I have been removing the whitelists in various PRs. Created an issue yesterday for this one #16778 |
b93ef5b
to
982a407
Compare
Rebased against latest master. |
As this no longer contains any changes not described in the topic of the PR, I'd suggest to merge it. (I guess @tbursztyka is on vacation, nor this is his known area of interest.) |
recheck |
We must query both IPv4 and IPv6 addresses if the hints parameter is NULL i.e., user does not supply hints or if family is set to AF_UNSPEC. Fixes zephyrproject-rtos#16453 Signed-off-by: Jukka Rissanen <[email protected]>
If user supplies AF_UNSPEC, we need to do two queries, one for IPv4 A record and one for IPv6 AAAA record. Signed-off-by: Jukka Rissanen <[email protected]>
982a407
to
ee8e8ab
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v1.14-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick cb52096f2cda2f9b69c73f4c5efab0aa1a30efe8 ee8e8abe4e05ae0aeab10c43705f41970be31172
# Create a new branch with these backported commits.
git checkout -b backport-16772-to-v1.14-branch
# Push it to GitHub.
git push --set-upstream origin backport-16772-to-v1.14-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport Then, create a pull request where the |
We must query both IPv4 and IPv6 addresses if the hints parameter
is NULL i.e., user does not supply hints.
Fixes #16453
Signed-off-by: Jukka Rissanen [email protected]