dirmngr: Fix http lookups when libadns is used.
authorJustus Winter <justus@g10code.com>
Mon, 23 Nov 2015 14:41:36 +0000 (15:41 +0100)
committerJustus Winter <justus@g10code.com>
Mon, 23 Nov 2015 14:53:41 +0000 (15:53 +0100)
* dirmngr/dns-stuff.c (resolve_name_adns): Fill in the port.
--
Previously, sin_port was set to zero, making connect fail.

Signed-off-by: Justus Winter <justus@g10code.com>
dirmngr/dns-stuff.c

index 694c04b..b3ad9bc 100644 (file)
@@ -253,7 +253,6 @@ resolve_name_adns (const char *name, unsigned short port,
   adns_answer *answer = NULL;
   int count;
 
-  (void)port;
   (void)want_family;
 
   *r_dai = NULL;
@@ -319,6 +318,7 @@ resolve_name_adns (const char *name, unsigned short port,
       dai->protocol = want_socktype == SOCK_STREAM? IPPROTO_TCP : IPPROTO_UDP;
       dai->addrlen = len;
       memcpy (dai->addr, &addr->addr.sa, len);
+      ((struct sockaddr_in *) dai->addr)->sin_port = htons (port);
       dai->next = daihead;
       daihead = dai;
       err = 0;