BUG/MINOR: resolvers: default resolvers fails when network not configured
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 18 Dec 2023 11:35:35 +0000 (12:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 19 Dec 2023 16:13:08 +0000 (17:13 +0100)
commit49242213556fa35f690698cd8aac6324370c4652
tree3d4ace4e19532f6fc53f4aede729fcd1b625ddaf
parentf72603ceb64ae944e9207f26d7dd99dba03e0d01
BUG/MINOR: resolvers: default resolvers fails when network not configured

Bug #1740 was opened again, this time a user is complaining about the
"can't create socket for nameserver". This can happen if the resolv.conf
file contains a class of address which was not configured on the
machine, for example IPv6.

The fix does the same as b10b1196b ("MINOR: resolvers: shut the warning
when "default" resolvers is implicit"), and uses the
"resolvers->conf.implicit" variable to emit the error.

Though it is not needed to convert the explicit behavior with a
ERR_WARN, because this is supposed to be an unrecoverable error, unlike
the connect().

Should fix issue #1740.

Must be backported were b10b1196b was backported. (as far as 2.6)

(cherry picked from commit 0d2ebb53f752502137479c9e753a96046d3254ab)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/resolvers.c