[Pkg-gnupg-commit] [gnupg2] 70/132: dirmngr: Fix http.c for sockaddr_storage.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed May 17 03:07:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 86dcb03134fd4957d51ebaa06b7991239f9ee56a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Apr 13 14:46:57 2017 +0900

    dirmngr: Fix http.c for sockaddr_storage.
    
    dirmngr/http.c (use_socks): Use sockaddr_storage.
    (my_sock_new_for_addr, connect_server): Likewise.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
 dirmngr/http.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dirmngr/http.c b/dirmngr/http.c
index 356e2bc..e645a54 100644
--- a/dirmngr/http.c
+++ b/dirmngr/http.c
@@ -2470,13 +2470,13 @@ start_server ()
  * This function is basically a copy of the same internal fucntion in
  * Libassuan.  */
 static int
-use_socks (struct sockaddr *addr)
+use_socks (struct sockaddr_storage *addr)
 {
   int mode;
 
   if (assuan_sock_get_flag (ASSUAN_INVALID_FD, "tor-mode", &mode) || !mode)
     return 0;  /* Not in Tor mode.  */
-  else if (addr->sa_family == AF_INET6)
+  else if (addr->ss_family == AF_INET6)
     {
       struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr;
       const unsigned char *s;
@@ -2491,7 +2491,7 @@ use_socks (struct sockaddr *addr)
 
       return 0; /* This is the loopback address.  */
     }
-  else if (addr->sa_family == AF_INET)
+  else if (addr->ss_family == AF_INET)
     {
       struct sockaddr_in *addr_in = (struct sockaddr_in *)addr;
 
@@ -2508,7 +2508,7 @@ use_socks (struct sockaddr *addr)
 /* Wrapper around assuan_sock_new which takes the domain from an
  * address parameter.  */
 static assuan_fd_t
-my_sock_new_for_addr (struct sockaddr *addr, int type, int proto)
+my_sock_new_for_addr (struct sockaddr_storage *addr, int type, int proto)
 {
   int domain;
 
@@ -2519,7 +2519,7 @@ my_sock_new_for_addr (struct sockaddr *addr, int type, int proto)
       domain = AF_INET;
     }
   else
-    domain = addr->sa_family;
+    domain = addr->ss_family;
 
   return assuan_sock_new (domain, type, proto);
 }
@@ -2644,7 +2644,8 @@ connect_server (const char *server, unsigned short port,
             }
 
           anyhostaddr = 1;
-          if (assuan_sock_connect (sock, ai->addr, ai->addrlen))
+          if (assuan_sock_connect (sock, (struct sockaddr *)ai->addr,
+                                   ai->addrlen))
             {
               last_err = gpg_err_make (default_errsource,
                                        gpg_err_code_from_syserror ());

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list