diff options
author | Justus Winter <[email protected]> | 2015-11-16 17:18:25 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2015-11-17 09:53:10 +0000 |
commit | ebba10cf9edd2df5e46333cda991cf3168f2d662 (patch) | |
tree | f077356cc407495deaaa6a6243e18e97f1b53957 /dirmngr | |
parent | gpg: Fix error checking and improve error reporting. (diff) | |
download | gnupg-justus/issue2012.tar.gz gnupg-justus/issue2012.zip |
dirmngr: Fix specifying keyservers by IP address.justus/issue2012
Previously, if a keyserver was given using its IP address
(e.g. 'hkp://127.0.0.1'), 'map_host' would create two entries in the
'hosttable', one with the name '127.0.0.1', and the second one with
the name 'localhost' and 'v4addr' being set to '127.0.0.1'. But the
first entry is the one being used for lookups, and since the 'v4' flag
is not set, the 'HTTP_FLAG_IGNORE_IPv4' is used when doing the http
request, making it fail.
* dirmngr/ks-engine-hkp.c (map_host): Update the original 'hosttable'
entry instead of creating another one.
Signed-off-by: Justus Winter <[email protected]>
GnuPG-bug-id: 2012
Diffstat (limited to 'dirmngr')
-rw-r--r-- | dirmngr/ks-engine-hkp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c index a6587271c..7051a5b68 100644 --- a/dirmngr/ks-engine-hkp.c +++ b/dirmngr/ks-engine-hkp.c @@ -378,7 +378,11 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect, } else { - tmpidx = find_hostinfo (tmphost); + if (!is_pool && is_ip_address (name)) + /* Update the original entry. */ + tmpidx = idx; + else + tmpidx = find_hostinfo (tmphost); log_info ("resolve_dns_addr for '%s': '%s'%s\n", name, tmphost, tmpidx == -1? "" : " [already known]"); |