Skip to content

ares_gethostbyname: fake hostent for AF_UNSPEC#204

Merged
bradh352 merged 1 commit into
c-ares:masterfrom
Seraphime:fakehostent_with_af_unspec
Aug 27, 2020
Merged

ares_gethostbyname: fake hostent for AF_UNSPEC#204
bradh352 merged 1 commit into
c-ares:masterfrom
Seraphime:fakehostent_with_af_unspec

Conversation

@Seraphime

Copy link
Copy Markdown
Contributor

Currently, the conditional which decides whether the specified host
is an IPv4 address verifies whether family is AF_INET or AF_INET6
which is equivalent to saying family is AF_UNSPEC, but users of
AF_UNSPEC cannot fake IPv4 hosts.

Currently, the conditional which decides whether the specified host
is an IPv4 address verifies whether family is AF_INET or AF_INET6
which is equivalent to saying family is AF_UNSPEC, but users of
AF_UNSPEC cannot fake IPv4 hosts.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.002%) to 92.952% when pulling 4b522d5 on Seraphime:fakehostent_with_af_unspec into 7ebedab on c-ares:master.

@Seraphime

Copy link
Copy Markdown
Contributor Author

The reason the coverage has fallen by 0.002% is because the if checking for IPv4 addresses is no longer executed for family == AF_INET6, which is nonsensical anyways.

@bradh352 bradh352 merged commit c4764c2 into c-ares:master Aug 27, 2020
sergepetrenko pushed a commit to tarantool/c-ares that referenced this pull request Jul 29, 2022
…-ares#204)

fake_hostent() was not supporting AF_UNSPEC, so when an ip address was specified when using AF_UNSPEC it would attempt to do a DNS lookup rather than returning a fake hostent using the ip address.

Fix By: Seraphime Kirkovski (@Seraphime)
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.

3 participants