wget: backport upstream fix to re-enable disabling ipv6
authorHannu Nyman <hannu.nyman@iki.fi>
Thu, 26 Nov 2015 17:21:23 +0000 (19:21 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Thu, 26 Nov 2015 17:21:23 +0000 (19:21 +0200)
Upstream wget 1.17 compilation breaks with --disable-ipv6 configuration.
Backport an upstream commit that fixes the disabling of ipv6 in wget.
http://git.savannah.gnu.org/cgit/wget.git/commit/?id=2cfcadf5e6d5c444765aa460915ae27109a8dbce

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
net/wget/Makefile
net/wget/patches/200-upstream-fix-117-with-ipv6-disabled.patch [new file with mode: 0644]

index ad00bdbb3df5b06d197f22cc3a6894e61e4b974d..75791b571947a9f013750314ef11145241e84214 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wget
 PKG_VERSION:=1.17
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
diff --git a/net/wget/patches/200-upstream-fix-117-with-ipv6-disabled.patch b/net/wget/patches/200-upstream-fix-117-with-ipv6-disabled.patch
new file mode 100644 (file)
index 0000000..6e07573
--- /dev/null
@@ -0,0 +1,147 @@
+From 2cfcadf5e6d5c444765aa460915ae27109a8dbce Mon Sep 17 00:00:00 2001
+From: Darshit Shah <darnir@gmail.com>
+Date: Mon, 16 Nov 2015 23:16:25 +0000
+Subject: Fix compile error when IPv6 is disabled
+
+* src/ftp-basic.c: The code for the new FTPS functionality was unintentionally
+inside a #ifdef IPV6 block. Move the code around so that it is defined even when
+IPV6 isn't used
+---
+diff --git a/src/ftp-basic.c b/src/ftp-basic.c
+index bcb7847..378374c 100644
+--- a/src/ftp-basic.c
++++ b/src/ftp-basic.c
+@@ -429,6 +429,65 @@ ip_address_to_eprt_repr (const ip_address *addr, int port, char *buf,
+   buf[buflen - 1] = '\0';
+ }
++/* Bind a port and send the appropriate PORT command to the FTP
++   server.  Use acceptport after RETR, to get the socket of data
++   connection.  */
++uerr_t
++ftp_eprt (int csock, int *local_sock)
++{
++  uerr_t err;
++  char *request, *respline;
++  ip_address addr;
++  int nwritten;
++  int port;
++  /* Must contain the argument of EPRT (of the form |af|addr|port|).
++   * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
++   * 1 char for af (1-2) and 5 chars for port (0-65535) */
++  char bytes[4 + INET6_ADDRSTRLEN + 1 + 5 + 1];
++
++  /* Get the address of this side of the connection. */
++  if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL))
++    return FTPSYSERR;
++
++  /* Setting port to 0 lets the system choose a free port.  */
++  port = 0;
++
++  /* Bind the port.  */
++  *local_sock = bind_local (&addr, &port);
++  if (*local_sock < 0)
++    return FTPSYSERR;
++
++  /* Construct the argument of EPRT (of the form |af|addr|port|). */
++  ip_address_to_eprt_repr (&addr, port, bytes, sizeof (bytes));
++
++  /* Send PORT request.  */
++  request = ftp_request ("EPRT", bytes);
++  nwritten = fd_write (csock, request, strlen (request), -1);
++  if (nwritten < 0)
++    {
++      xfree (request);
++      fd_close (*local_sock);
++      return WRITEFAILED;
++    }
++  xfree (request);
++  /* Get appropriate response.  */
++  err = ftp_response (csock, &respline);
++  if (err != FTPOK)
++    {
++      fd_close (*local_sock);
++      return err;
++    }
++  if (*respline != '2')
++    {
++      xfree (respline);
++      fd_close (*local_sock);
++      return FTPPORTERR;
++    }
++  xfree (respline);
++  return FTPOK;
++}
++#endif
++
+ #ifdef HAVE_SSL
+ /*
+  * The following three functions defined into this #ifdef block
+@@ -542,65 +601,6 @@ bail:
+ }
+ #endif /* HAVE_SSL */
+-/* Bind a port and send the appropriate PORT command to the FTP
+-   server.  Use acceptport after RETR, to get the socket of data
+-   connection.  */
+-uerr_t
+-ftp_eprt (int csock, int *local_sock)
+-{
+-  uerr_t err;
+-  char *request, *respline;
+-  ip_address addr;
+-  int nwritten;
+-  int port;
+-  /* Must contain the argument of EPRT (of the form |af|addr|port|).
+-   * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
+-   * 1 char for af (1-2) and 5 chars for port (0-65535) */
+-  char bytes[4 + INET6_ADDRSTRLEN + 1 + 5 + 1];
+-
+-  /* Get the address of this side of the connection. */
+-  if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL))
+-    return FTPSYSERR;
+-
+-  /* Setting port to 0 lets the system choose a free port.  */
+-  port = 0;
+-
+-  /* Bind the port.  */
+-  *local_sock = bind_local (&addr, &port);
+-  if (*local_sock < 0)
+-    return FTPSYSERR;
+-
+-  /* Construct the argument of EPRT (of the form |af|addr|port|). */
+-  ip_address_to_eprt_repr (&addr, port, bytes, sizeof (bytes));
+-
+-  /* Send PORT request.  */
+-  request = ftp_request ("EPRT", bytes);
+-  nwritten = fd_write (csock, request, strlen (request), -1);
+-  if (nwritten < 0)
+-    {
+-      xfree (request);
+-      fd_close (*local_sock);
+-      return WRITEFAILED;
+-    }
+-  xfree (request);
+-  /* Get appropriate response.  */
+-  err = ftp_response (csock, &respline);
+-  if (err != FTPOK)
+-    {
+-      fd_close (*local_sock);
+-      return err;
+-    }
+-  if (*respline != '2')
+-    {
+-      xfree (respline);
+-      fd_close (*local_sock);
+-      return FTPPORTERR;
+-    }
+-  xfree (respline);
+-  return FTPOK;
+-}
+-#endif
+-
+ /* Similar to ftp_port, but uses `PASV' to initiate the passive FTP
+    transfer.  Reads the response from server and parses it.  Reads the
+    host and port addresses and returns them.  */
+--
+cgit v0.9.0.2