[oe-commits] org.oe.dev wget 1.9.1: Make it work when you have no IPv6 support in the kernel

lenehan commit openembedded-commits at lists.openembedded.org
Sat Jun 2 00:49:36 UTC 2007


wget 1.9.1: Make it work when you have no IPv6 support in the kernel
- if it fails to create an IPv6 socket because of lack of kernel
support switch the internal default to IPv4 and retry the failed
connection. The default change will apply to all future sockets (for
this run of wget) as well. Should close #1919 and #2390.

Author: lenehan at openembedded.org
Branch: org.openembedded.dev
Revision: a6c82d6ca5e919305450c789a899a77b952c54a7
ViewMTN: http://monotone.openembedded.org/revision.psp?id=a6c82d6ca5e919305450c789a899a77b952c54a7
Files:
1
packages/wget/wget-1.9.1/ipv6-fix.patch
packages/wget/wget_1.9.1.bb
Diffs:

#
# mt diff -r6094f492d3818a816b3ffce11b42913b2abb86dd -ra6c82d6ca5e919305450c789a899a77b952c54a7
#
# 
# 
# add_file "packages/wget/wget-1.9.1/ipv6-fix.patch"
#  content [ce4823b8b6806960be07883c0318d5b7bf51d131]
# 
# patch "packages/wget/wget_1.9.1.bb"
#  from [a8b2669d6bd62afbf8059685ca5b98177c7bec76]
#    to [a4a10f89b3881f44d04ce90c4373b97204509043]
# 
============================================================
--- packages/wget/wget-1.9.1/ipv6-fix.patch	ce4823b8b6806960be07883c0318d5b7bf51d131
+++ packages/wget/wget-1.9.1/ipv6-fix.patch	ce4823b8b6806960be07883c0318d5b7bf51d131
@@ -0,0 +1,31 @@
+If the kernel has IPv6 support then wget tries to create sockets using
+AF_INET6 and then gets an EAFNOSUPPORT error, which it treats as a
+connection failure, resulting in wget not being able to work. This patch
+makes it switch it's default protocol to IPv4 when it sees that IPv6 isn't
+supported in the kernel.
+
+Index: wget-1.9.1/src/connect.c
+===================================================================
+--- wget-1.9.1.orig/src/connect.c	2003-11-02 01:08:22.000000000 +1100
++++ wget-1.9.1/src/connect.c	2007-06-02 01:39:55.000000000 +1000
+@@ -244,12 +244,20 @@
+     {
+       ip_address addr;
+       int sock;
++retry:
+       address_list_copy_one (al, i, &addr);
+ 
+       sock = connect_to_one (&addr, port, silent);
+       if (sock >= 0)
+ 	/* Success. */
+ 	return sock;
++      
++      if (errno == EAFNOSUPPORT && ip_default_family == AF_INET6)
++      {
++        DEBUGP (("No IPv6 support, changing default to IPv4.\n"));
++        ip_default_family = AF_INET;
++        goto retry;
++      }
+ 
+       address_list_set_faulty (al, i);
+ 
============================================================
--- packages/wget/wget_1.9.1.bb	a8b2669d6bd62afbf8059685ca5b98177c7bec76
+++ packages/wget/wget_1.9.1.bb	a4a10f89b3881f44d04ce90c4373b97204509043
@@ -1,12 +1,13 @@ DEPENDS = ""
 DESCRIPTION = "A console URL download utility featuring HTTP, FTP, and more."
 SECTION = "console/network"
 DEPENDS = ""
-PR = "r6"
+PR = "r7"
 LICENSE = "GPL"
 
 SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
 	   file://m4macros.patch;patch=1 \
-	   file://autotools.patch;patch=1"
+	   file://autotools.patch;patch=1 \
+           file://ipv6-fix.patch;patch=1"
 S = "${WORKDIR}/wget-${PV}"
 
 inherit autotools gettext






More information about the Openembedded-commits mailing list