Re: curl to testing, please
On Sun, Dec 28, 2008 at 03:26:58PM +0100, Andreas Schuldei wrote:
> * Neil McGovern (maulkin@halon.org.uk) [081228 13:05]:
> > On Sat, Dec 27, 2008 at 03:10:58PM +0100, Andreas Schuldei wrote:
> > > hi
> > >
> > > i just uploaded curl-7.18.2-8, which fixes #506096, a regression (ldap
> > > worked in etch).
> >
> > There also seem to be a lot of ipv6 changes. Are these related?
>
> do you look at the .diff or a debdiff against curl-7.18.2-7? the ipv6
> changes went in at an earlier point (see changelog) and are from the
> upstream repository, nowerdays released in curl-7.19.
>
I'm looking at diffstat for curl_7.18.2-5 to curl_7.18.2-8, which is the
one in testing to the one in unstable. Report attached.
Neil
--
A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?
gpg key - http://www.halon.org.uk/pubkey.txt ; the.earth.li B345BDD3
==> freeze
# Libraries (reverse deps of 50 or more)
block curl
diffstat for curl_7.18.2-5 curl_7.18.2-8
curl-7.18.2/debian/changelog | 19 +
curl-7.18.2/debian/patches/c-ares_ipv6 | 394 +++++++++++++++++++++++++++------
curl-7.18.2/debian/rules | 6
debian/.pc/.version | 1
4 files changed, 345 insertions(+), 75 deletions(-)
diff -u curl-7.18.2/debian/rules curl-7.18.2/debian/rules
--- curl-7.18.2/debian/rules
+++ curl-7.18.2/debian/rules
@@ -45,11 +45,11 @@
# this will catch miss-linking. (e.g. undefined symbols)
LDFLAGS = -Wl,-z,defs
-CONFIGURE_ARGS = $(CROSS) --prefix=/usr --mandir=/usr/share/man --disable-dependency-tracking --enable-ipv6 --enable-ldaps --with-lber-lib=/usr/lib/liblber.so --enable-manual --enable-versioned-symbols
+CONFIGURE_ARGS = $(CROSS) --prefix=/usr --mandir=/usr/share/man --disable-dependency-tracking --enable-ipv6 --enable-ldaps --with-lber-lib=lber --enable-manual --enable-versioned-symbols
+# this is still not ready
+# --enable-ares
# this fixes the ldap warning of dpkg-shlibdebs, but we dont want that.
# --with-ldap-lib=/usr/lib/libldap_r.so
-# cares is not yet ready to release with curl for a stable release.
-# --enable-ares
ifneq (${DEB_BUILD_ARCH_OS},hurd)
CONFIGURE_ARGS += --with-gssapi=/usr
diff -u curl-7.18.2/debian/changelog curl-7.18.2/debian/changelog
--- curl-7.18.2/debian/changelog
+++ curl-7.18.2/debian/changelog
@@ -1,3 +1,22 @@
+curl (7.18.2-8) unstable; urgency=low
+
+ * Fix "Please add support for ldap/ldaps protocols"
+ by changing the linker option for liblber (Closes: #506096)
+
+ -- Andreas Schuldei <andreas@debian.org> Fri, 26 Dec 2008 23:48:19 +0100
+
+curl (7.18.2-7) unstable; urgency=low
+
+ * disable c-ares support again, no fix yet, just get stuff working again.
+
+ -- Andreas Schuldei <andreas@debian.org> Tue, 15 Jul 2008 01:17:29 +0200
+
+curl (7.18.2-6) unstable; urgency=low
+
+ * enable c-ares support, with ipv6 support
+
+ -- Andreas Schuldei <andreas@debian.org> Fri, 11 Jul 2008 02:05:16 +0200
+
curl (7.18.2-5) unstable; urgency=low
* /usr/lib/pkgconfig/libcurl.pc: "pkg-config --libs libcurl" returns
diff -u curl-7.18.2/debian/patches/c-ares_ipv6 curl-7.18.2/debian/patches/c-ares_ipv6
--- curl-7.18.2/debian/patches/c-ares_ipv6
+++ curl-7.18.2/debian/patches/c-ares_ipv6
@@ -1,8 +1,17 @@
Index: trunk/lib/hostares.c
===================================================================
---- trunk.orig/lib/hostares.c 2008-06-25 21:59:03.000000000 +0200
-+++ trunk/lib/hostares.c 2008-06-25 22:10:40.000000000 +0200
-@@ -297,6 +297,62 @@
+--- trunk.orig/lib/hostares.c 2008-06-27 03:51:47.000000000 +0200
++++ trunk/lib/hostares.c 2008-07-11 01:30:24.000000000 +0200
+@@ -18,7 +18,7 @@
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+- * $Id: hostares.c,v 1.37 2008-04-29 04:18:02 yangtse Exp $
++ * $Id: hostares.c,v 1.38 2008-07-09 18:39:49 bagder Exp $
+ ***************************************************************************/
+
+ #include "setup.h"
+@@ -297,6 +297,70 @@
return rc;
}
@@ -21,7 +30,8 @@
+{
+ Curl_addrinfo *ai;
+
-+#if defined(VMS) && defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
++#if defined(VMS) && defined(__INITIAL_POINTER_SIZE) && \
++ (__INITIAL_POINTER_SIZE == 64)
+#pragma pointer_size save
+#pragma pointer_size short
+#pragma message disable PTRMISMATCH
@@ -35,27 +45,34 @@
+ struct in6_addr addrentry;
+ char hostname[1];
+ };
-+ struct namebuf6 *buf = alloca (sizeof (struct namebuf6) + strlen(hostname));
++ struct namebuf6 *buf = malloc(sizeof (struct namebuf6) + strlen(hostname));
+
++ if(!buf)
++ return NULL;
+
+ h = &buf->hostentry;
+ h->h_addr_list = &buf->h_addr_list[0];
+ addrentry = &buf->addrentry;
+ memcpy(addrentry, in, sizeof (*in));
+ h->h_addr_list[0] = (char*)addrentry;
++ h->h_addr_list[1] = NULL; /* terminate list of entries */
+ h->h_name = &buf->hostname[0];
+ h->h_aliases = NULL;
++ h->h_addrtype = AF_INET6;
+
+ /* Now store the dotted version of the address */
+ strcpy (h->h_name, hostname);
+
-+#if defined(VMS) && defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
++#if defined(VMS) && defined(__INITIAL_POINTER_SIZE) && \
++ (__INITIAL_POINTER_SIZE == 64)
+#pragma pointer_size restore
+#pragma message enable PTRMISMATCH
+#endif
+
+ ai = Curl_he2ai(h, port);
+
++ free(buf);
++
+ return ai;
+}
+#endif /* CURLRES_IPV6 */
@@ -65,7 +82,7 @@
/*
* Curl_getaddrinfo() - when using ares
*
-@@ -313,7 +369,10 @@
+@@ -313,7 +377,10 @@
char *bufp;
struct SessionHandle *data = conn->data;
in_addr_t in = inet_addr(hostname);
@@ -77,7 +94,7 @@
*waitp = FALSE;
if(in != CURL_INADDR_NONE) {
-@@ -321,6 +380,15 @@
+@@ -321,6 +388,23 @@
return Curl_ip2addr(in, hostname, port);
}
@@ -87,13 +104,21 @@
+ return Curl_ip2addr6(&in6, hostname, port);
+ }
+
-+ family = PF_INET6;
++ switch(data->set.ip_version) {
++ case CURL_IPRESOLVE_V4:
++ family = PF_INET;
++ break;
++ default: /* by default we try ipv6, as PF_UNSPEC isn't supported by (c-)ares */
++ case CURL_IPRESOLVE_V6:
++ family = PF_INET6;
++ break;
++ }
+#endif /* CURLRES_IPV6 */
+
bufp = strdup(hostname);
if(bufp) {
-@@ -332,7 +400,7 @@
+@@ -332,7 +416,7 @@
conn->async.dns = NULL; /* clear */
/* areschannel is already setup in the Curl_open() function */
@@ -104,54 +129,295 @@
*waitp = TRUE; /* please wait for the response */
Index: trunk/lib/hostip4.c
===================================================================
---- trunk.orig/lib/hostip4.c 2008-06-25 21:59:03.000000000 +0200
-+++ trunk/lib/hostip4.c 2008-06-25 22:10:10.000000000 +0200
-@@ -346,6 +346,9 @@
- Curl_addrinfo *prevai = NULL;
- Curl_addrinfo *firstai = NULL;
- struct sockaddr_in *addr;
-+#if (defined(ENABLE_IPV6) && defined(USE_ARES)) /* CURLRES_IPV6 */
-+ struct sockaddr_in6 *addr6;
-+#endif /* CURLRES_IPV6 */
- int i;
- struct in_addr *curr;
+--- trunk.orig/lib/hostip4.c 2008-06-27 03:51:47.000000000 +0200
++++ trunk/lib/hostip4.c 2008-07-11 01:31:01.000000000 +0200
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -18,7 +18,7 @@
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+- * $Id: hostip4.c,v 1.42 2007-11-07 09:21:35 bagder Exp $
++ * $Id: hostip4.c,v 1.43 2008-07-09 18:39:49 bagder Exp $
+ ***************************************************************************/
+
+ #include "setup.h"
+@@ -307,91 +307,3 @@
+ #endif /* CURLRES_SYNCH */
+ #endif /* CURLRES_IPV4 */
+
+-/*
+- * Curl_he2ai() translates from a hostent struct to a Curl_addrinfo struct.
+- * The Curl_addrinfo is meant to work like the addrinfo struct does for IPv6
+- * stacks, but for all hosts and environments.
+- *
+- * Curl_addrinfo defined in "lib/hostip.h"
+- *
+- * struct Curl_addrinfo {
+- * int ai_flags;
+- * int ai_family;
+- * int ai_socktype;
+- * int ai_protocol;
+- * socklen_t ai_addrlen; * Follow rfc3493 struct addrinfo *
+- * char *ai_canonname;
+- * struct sockaddr *ai_addr;
+- * struct Curl_addrinfo *ai_next;
+- * };
+- *
+- * hostent defined in <netdb.h>
+- *
+- * struct hostent {
+- * char *h_name;
+- * char **h_aliases;
+- * int h_addrtype;
+- * int h_length;
+- * char **h_addr_list;
+- * };
+- *
+- * for backward compatibility:
+- *
+- * #define h_addr h_addr_list[0]
+- */
+-
+-Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
+-{
+- Curl_addrinfo *ai;
+- Curl_addrinfo *prevai = NULL;
+- Curl_addrinfo *firstai = NULL;
+- struct sockaddr_in *addr;
+- int i;
+- struct in_addr *curr;
+-
+- if(!he)
+- /* no input == no output! */
+- return NULL;
+-
+- for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]) != NULL; i++) {
+-
+- ai = calloc(1, sizeof(Curl_addrinfo) + sizeof(struct sockaddr_in));
+-
+- if(!ai)
+- break;
+-
+- if(!firstai)
+- /* store the pointer we want to return from this function */
+- firstai = ai;
+-
+- if(prevai)
+- /* make the previous entry point to this */
+- prevai->ai_next = ai;
+-
+- ai->ai_family = AF_INET; /* we only support this */
+-
+- /* we return all names as STREAM, so when using this address for TFTP
+- the type must be ignored and conn->socktype be used instead! */
+- ai->ai_socktype = SOCK_STREAM;
+-
+- ai->ai_addrlen = sizeof(struct sockaddr_in);
+- /* make the ai_addr point to the address immediately following this struct
+- and use that area to store the address */
+- ai->ai_addr = (struct sockaddr *) ((char*)ai + sizeof(Curl_addrinfo));
+-
+- /* FIXME: need to free this eventually */
+- ai->ai_canonname = strdup(he->h_name);
+-
+- /* leave the rest of the struct filled with zero */
+-
+- addr = (struct sockaddr_in *)ai->ai_addr; /* storage area for this info */
+-
+- memcpy((char *)&(addr->sin_addr), curr, sizeof(struct in_addr));
+- addr->sin_family = (unsigned short)(he->h_addrtype);
+- addr->sin_port = htons((unsigned short)port);
+-
+- prevai = ai;
+- }
+- return firstai;
+-}
+-
+Index: trunk/lib/hostip.h
+===================================================================
+--- trunk.orig/lib/hostip.h 2008-06-27 03:51:47.000000000 +0200
++++ trunk/lib/hostip.h 2008-07-11 01:30:55.000000000 +0200
+@@ -20,7 +20,7 @@
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+- * $Id: hostip.h,v 1.61 2008-01-15 22:44:12 bagder Exp $
++ * $Id: hostip.h,v 1.62 2008-07-09 18:39:49 bagder Exp $
+ ***************************************************************************/
-@@ -355,7 +358,13 @@
+ #include "setup.h"
+@@ -104,6 +104,10 @@
+ */
+ #ifdef CURLRES_IPV6
+ typedef struct addrinfo Curl_addrinfo;
++#ifdef CURLRES_ARES
++Curl_addrinfo *Curl_ip2addr6(struct in6_addr *in,
++ const char *hostname, int port);
++#endif
+ #else
+ /* OK, so some ipv4-only include tree probably have the addrinfo struct, but
+ to work even on those that don't, we provide our own look-alike! */
+Index: trunk/CHANGES
+===================================================================
+--- trunk.orig/CHANGES 2008-07-11 01:26:35.000000000 +0200
++++ trunk/CHANGES 2008-07-11 01:32:29.000000000 +0200
+@@ -9,6 +9,11 @@
+
+ Version 7.18.2 (4 June 2008)
+
++Daniel Stenberg (9 Jul 2008)
++- Andreas Schuldei improved Phil Blundell's patch for IPv6 using c-ares, and I
++ edited it slightly. Now you should be able to use IPv6 addresses fine even
++ with libcurl built to use c-ares.
++
+ Daniel Fandrich (3 Jun 2008)
+ - Fixed a problem where telnet data would be lost if an EWOULDBLOCK
+ condition were encountered.
+Index: trunk/RELEASE-NOTES
+===================================================================
+--- trunk.orig/RELEASE-NOTES 2008-07-11 01:26:49.000000000 +0200
++++ trunk/RELEASE-NOTES 2008-07-11 01:35:17.000000000 +0200
+@@ -15,6 +15,7 @@
+ o curl can now run on Symbian OS
+ o curl -w redirect_url and CURLINFO_REDIRECT_URL
+ o added curl_easy_send() and curl_easy_recv()
++ o c-ares powered libcurls can resolve/use IPv6 addresses
+
+ This release includes the following bugfixes:
+
+@@ -64,5 +65,6 @@
+ David Shaw, Norbert Frese, Bart Whiteley, Jean-Francois Bertrand, Ben Van Hof,
+ Yuriy Sosov, Christopher Palow, Yang Tse, Liam Healy, Nikolai Kondrashov,
+ David Rosenstrauch, Andreas Faerber, Scott McCreary, Jeff Weber, Emil Romanus
++ Rolland Dudemaine, Phil Blundell, Scott Barrett, Andreas Schuldei
+
+- Thanks! (and sorry if I forgot to mention someone)
++ Thanks! (and sorry if I forgot to mention someone)
+Index: trunk/lib/hostip.c
+===================================================================
+--- trunk.orig/lib/hostip.c 2008-07-11 01:25:33.000000000 +0200
++++ trunk/lib/hostip.c 2008-07-11 01:30:45.000000000 +0200
+@@ -18,7 +18,7 @@
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+- * $Id: hostip.c,v 1.191 2008-03-11 22:55:24 bagder Exp $
++ * $Id: hostip.c,v 1.192 2008-07-09 18:39:49 bagder Exp $
+ ***************************************************************************/
+
+ #include "setup.h"
+@@ -545,7 +545,8 @@
+ #endif /* CURLRES_ADDRINFO_COPY */
+
+ /***********************************************************************
+- * Only for plain-ipv4 and c-ares builds
++ * Only for plain-ipv4 and c-ares builds (NOTE: c-ares builds can be IPv6
++ * enabled)
+ **********************************************************************/
- for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]) != NULL; i++) {
+ #if defined(CURLRES_IPV4) || defined(CURLRES_ARES)
+@@ -630,6 +631,118 @@
-- ai = calloc(1, sizeof(Curl_addrinfo) + sizeof(struct sockaddr_in));
-+ int ss_size = sizeof (struct sockaddr_in);
-+#if (defined(ENABLE_IPV6) && defined(USE_ARES)) /* CURLRES_IPV6 */
+ return ai;
+ }
+-#endif /* CURLRES_IPV4 || CURLRES_ARES */
+
++/*
++ * Curl_he2ai() translates from a hostent struct to a Curl_addrinfo struct.
++ * The Curl_addrinfo is meant to work like the addrinfo struct does for IPv6
++ * stacks, but for all hosts and environments.
++ *
++ * Curl_addrinfo defined in "lib/hostip.h"
++ *
++ * struct Curl_addrinfo {
++ * int ai_flags;
++ * int ai_family;
++ * int ai_socktype;
++ * int ai_protocol;
++ * socklen_t ai_addrlen; * Follow rfc3493 struct addrinfo *
++ * char *ai_canonname;
++ * struct sockaddr *ai_addr;
++ * struct Curl_addrinfo *ai_next;
++ * };
++ *
++ * hostent defined in <netdb.h>
++ *
++ * struct hostent {
++ * char *h_name;
++ * char **h_aliases;
++ * int h_addrtype;
++ * int h_length;
++ * char **h_addr_list;
++ * };
++ *
++ * for backward compatibility:
++ *
++ * #define h_addr h_addr_list[0]
++ */
++
++Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
++{
++ Curl_addrinfo *ai;
++ Curl_addrinfo *prevai = NULL;
++ Curl_addrinfo *firstai = NULL;
++ struct sockaddr_in *addr;
++#ifdef CURLRES_IPV6
++ struct sockaddr_in6 *addr6;
++#endif /* CURLRES_IPV6 */
++ int i;
++ struct in_addr *curr;
++
++ if(!he)
++ /* no input == no output! */
++ return NULL;
++
++ for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]) != NULL; i++) {
++
++ int ss_size;
++#ifdef CURLRES_IPV6
+ if (he->h_addrtype == AF_INET6)
+ ss_size = sizeof (struct sockaddr_in6);
++ else
+#endif /* CURLRES_IPV6 */
++ ss_size = sizeof (struct sockaddr_in);
+
+ ai = calloc(1, sizeof(Curl_addrinfo) + ss_size);
++
++ if(!ai)
++ break;
- if(!ai)
- break;
-@@ -368,13 +377,13 @@
- /* make the previous entry point to this */
- prevai->ai_next = ai;
-
-- ai->ai_family = AF_INET; /* we only support this */
++ if(!firstai)
++ /* store the pointer we want to return from this function */
++ firstai = ai;
++
++ if(prevai)
++ /* make the previous entry point to this */
++ prevai->ai_next = ai;
++
+ ai->ai_family = he->h_addrtype;
-
- /* we return all names as STREAM, so when using this address for TFTP
- the type must be ignored and conn->socktype be used instead! */
- ai->ai_socktype = SOCK_STREAM;
-
-- ai->ai_addrlen = sizeof(struct sockaddr_in);
++
++ /* we return all names as STREAM, so when using this address for TFTP
++ the type must be ignored and conn->socktype be used instead! */
++ ai->ai_socktype = SOCK_STREAM;
++
+ ai->ai_addrlen = ss_size;
- /* make the ai_addr point to the address immediately following this struct
- and use that area to store the address */
- ai->ai_addr = (struct sockaddr *) ((char*)ai + sizeof(Curl_addrinfo));
-@@ -384,11 +393,25 @@
-
- /* leave the rest of the struct filled with zero */
-
-- addr = (struct sockaddr_in *)ai->ai_addr; /* storage area for this info */
++ /* make the ai_addr point to the address immediately following this struct
++ and use that area to store the address */
++ ai->ai_addr = (struct sockaddr *) ((char*)ai + sizeof(Curl_addrinfo));
++
++ /* need to free this eventually */
++ ai->ai_canonname = strdup(he->h_name);
++
++ /* leave the rest of the struct filled with zero */
++
+ switch (ai->ai_family) {
+ case AF_INET:
+ addr = (struct sockaddr_in *)ai->ai_addr; /* storage area for this info */
@@ -160,11 +426,8 @@
+ addr->sin_family = (unsigned short)(he->h_addrtype);
+ addr->sin_port = htons((unsigned short)port);
+ break;
-
-- memcpy((char *)&(addr->sin_addr), curr, sizeof(struct in_addr));
-- addr->sin_family = (unsigned short)(he->h_addrtype);
-- addr->sin_port = htons((unsigned short)port);
-+#if (defined(ENABLE_IPV6) && defined(USE_ARES)) /* CURLRES_IPV6 */
++
++#ifdef CURLRES_IPV6
+ case AF_INET6:
+ addr6 = (struct sockaddr_in6 *)ai->ai_addr; /* storage area for this info */
+
@@ -175,20 +438,9 @@
-+#endif /* CURLRES_IPV6 */
++#endif /* CURLRES_IPV6 */
+ }
-
- prevai = ai;
- }
-Index: trunk/lib/hostip.h
-===================================================================
---- trunk.orig/lib/hostip.h 2008-06-25 21:59:03.000000000 +0200
-+++ trunk/lib/hostip.h 2008-06-25 22:10:10.000000000 +0200
-@@ -104,6 +104,10 @@
- */
- #ifdef CURLRES_IPV6
- typedef struct addrinfo Curl_addrinfo;
-+#ifdef CURLRES_ARES
-+Curl_addrinfo *Curl_ip2addr6(struct in6_addr *in,
-+ const char *hostname, int port);
-+#endif
- #else
- /* OK, so some ipv4-only include tree probably have the addrinfo struct, but
- to work even on those that don't, we provide our own look-alike! */
++
++ prevai = ai;
++ }
++ return firstai;
++}
++
++#endif /* CURLRES_IPV4 || CURLRES_ARES */
reverted:
--- curl-7.18.2/debian/.pc/.version
+++ curl-7.18.2.orig/debian/.pc/.version
@@ -1 +0,0 @@
-2
Reply to: