mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02: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
1 changed files with 4 additions and 0 deletions
|
@ -685,6 +685,8 @@ resolve_name_libdns (const char *name, unsigned short port,
|
|||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
if (r_canonname)
|
||||
hints.ai_flags |= AI_CANONNAME;
|
||||
if (is_ip_address (name))
|
||||
hints.ai_flags |= AI_NUMERICHOST;
|
||||
|
||||
if (port)
|
||||
{
|
||||
|
@ -806,6 +808,8 @@ resolve_name_standard (const char *name, unsigned short port,
|
|||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
if (r_canonname)
|
||||
hints.ai_flags |= AI_CANONNAME;
|
||||
if (is_ip_address (name))
|
||||
hints.ai_flags |= AI_NUMERICHOST;
|
||||
|
||||
if (port)
|
||||
snprintf (portstr, sizeof portstr, "%hu", port);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue