[BusyBox 0002764]: IPv6 support for busybox wget

bugs at busybox.net bugs at busybox.net
Fri Apr 4 03:14:59 UTC 2008

The following issue has been CLOSED 
Reported By:                Peter Eisentraut
Assigned To:                BusyBox
Project:                    BusyBox
Issue ID:                   2764
Category:                   Networking Support
Reproducibility:            have not tried
Severity:                   feature
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
Date Submitted:             04-03-2008 08:29 PDT
Last Modified:              04-03-2008 20:14 PDT
Summary:                    IPv6 support for busybox wget
I'm forwarding you this Debian bug report:
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395839>.  I am not an
experienced busybox user, but I found that the patch posted there is not
integrated in 1.9.2 yet, so it is probably still relevant.


The attached patch, written by Jaap Eldering during some Debian BSPs for
Etch in Utrecht, adds IPv6 support to busybox wget. This is wanted to
support new installations over IPv6 using Debian Installer.

Please review the patch and, if it looks OK, forward it upstream. I'm not
entirely sure if the patch is completely finished, but it has allowed the
author to actually use wget over IPv6.

Below are some comments from the author of the patch.

During yesterday evening's Bugsquashing "afterparty" I looked again
into this IPv6 stuff and made some progress: I got busybox wget to
download stuff over IPv{4,6} with http and ftp. Only thing is that it
didn't graciously fallback to IPv4 when a host (ftp.surfnet.nl)
rejected a connection on IPv6 ftp.

I fixed a bug in my code from last time, where the parameter passed to
'connect' indicating the size of the 'sockaddr *' struct was not
correct for IPv6 addresses.

Furthermore I cloned the two functions 'xconnect' and 'bb_lookup_host'
to 'xconnect2' and 'bb_lookup_host2' which take a pointer to a struct
of a IPv4 _and_ IPv6 address, to facilitate the possibility of
fallback at connect time.

The diff to Debian patched busybox-1.1.3-3 sources is again attached.
I'll probably try to fix this fallback behaviour in the next week or
so, but I'm not sure that I have time. If it is urgent to get this
into the etch installer, please let me know. The changes to the
functions 'xconnect' and 'bb_lookup_host' might better be dropped to
prevent bugs in other applets using those.


Another update, I think the last for the moment.

I found that ftp over IPv6 didn't work correctly because passive ftp
(which busybox wget uses) is implemented slightly different than over
IPv4. This patch makes wget handle the port switch correctly for IPv6
too. Furthermore I renamed the combined IPv{4,6} struct to
'sockaddr_in4_in6' to make things more clear.


 vda - 04-03-08 20:14  
This is fixed many versions ago. Now almost all networking applets work
over IPv6.

+struct sockaddr_in4_in6 {
+       int addr4_valid, addr6_valid;
+       struct in_addr  addr4;
+       struct in6_addr addr6;
+       in_port_t port;

Thank god we have only IPv4 and IPv6. It's horrifying to imagine how big
this struct can become if someone will ever decide to support e.g. Unix
domain sockets... Seriously, how about designing _generic_ interfaces? 

Issue History 
Date Modified   Username       Field                    Change               
04-03-08 08:29  Peter EisentrautNew Issue                                    
04-03-08 08:29  Peter EisentrautStatus                   new => assigned     
04-03-08 08:29  Peter EisentrautAssigned To               => BusyBox         
04-03-08 08:29  Peter EisentrautFile Added: busybox_1.1.3-3-ipv6-5.diff         
04-03-08 20:14  vda            Status                   assigned => closed  
04-03-08 20:14  vda            Note Added: 0006384                          

More information about the busybox-cvs mailing list