summaryrefslogtreecommitdiff
path: root/security/gnupg/patches/patch-ad
diff options
context:
space:
mode:
Diffstat (limited to 'security/gnupg/patches/patch-ad')
-rw-r--r--security/gnupg/patches/patch-ad36
1 files changed, 36 insertions, 0 deletions
diff --git a/security/gnupg/patches/patch-ad b/security/gnupg/patches/patch-ad
new file mode 100644
index 00000000000..cf38f216181
--- /dev/null
+++ b/security/gnupg/patches/patch-ad
@@ -0,0 +1,36 @@
+$NetBSD: patch-ad,v 1.4 2003/08/15 07:02:23 itojun Exp $
+
+ftp://ftp.kame.net/pub/kame/misc/gnupg-1.2.2-IPv6.diff.gz
+
+diff -u -r1.1.1.1 -r1.2
+--- util/http.c 15 Aug 2003 05:12:28 -0000 1.1.1.1
++++ util/http.c 15 Aug 2003 06:44:46 -0000 1.2
+@@ -753,6 +753,28 @@
+ sock_close (sd);
+ return -1;
+ }
++#elif defined(HAVE_GETADDRINFO)
++ struct addrinfo hints, *res0, *res;
++ char portstr[20];
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_socktype = SOCK_STREAM;
++ snprintf(portstr, sizeof(portstr), "%u", port);
++ if (getaddrinfo(server, portstr, &hints, &res0) != 0)
++ return -1;
++ for (res = res0; res; res = res->ai_next) {
++ sd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
++ if (sd < 0)
++ continue;
++ if (connect(sd, res->ai_addr, res->ai_addrlen) < 0) {
++ close(sd);
++ sd = -1;
++ continue;
++ }
++ break;
++ }
++ freeaddrinfo(res0);
++ return sd;
+ #else
+ struct sockaddr_in addr;
+ struct hostent *host;