mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
dirmngr: Avoid network queries for literal IP addresses.
* dirmngr/dns-stuff.c (resolve_name_libdns): USe flags AI_NUMERICHOST for literal IP addresses. (resolve_name_standard): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
82646bbf1a
commit
daae97bc14
@ -685,6 +685,8 @@ resolve_name_libdns (const char *name, unsigned short port,
|
|||||||
hints.ai_flags = AI_ADDRCONFIG;
|
hints.ai_flags = AI_ADDRCONFIG;
|
||||||
if (r_canonname)
|
if (r_canonname)
|
||||||
hints.ai_flags |= AI_CANONNAME;
|
hints.ai_flags |= AI_CANONNAME;
|
||||||
|
if (is_ip_address (name))
|
||||||
|
hints.ai_flags |= AI_NUMERICHOST;
|
||||||
|
|
||||||
if (port)
|
if (port)
|
||||||
{
|
{
|
||||||
@ -806,6 +808,8 @@ resolve_name_standard (const char *name, unsigned short port,
|
|||||||
hints.ai_flags = AI_ADDRCONFIG;
|
hints.ai_flags = AI_ADDRCONFIG;
|
||||||
if (r_canonname)
|
if (r_canonname)
|
||||||
hints.ai_flags |= AI_CANONNAME;
|
hints.ai_flags |= AI_CANONNAME;
|
||||||
|
if (is_ip_address (name))
|
||||||
|
hints.ai_flags |= AI_NUMERICHOST;
|
||||||
|
|
||||||
if (port)
|
if (port)
|
||||||
snprintf (portstr, sizeof portstr, "%hu", port);
|
snprintf (portstr, sizeof portstr, "%hu", port);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user