Subject: pkg/29279: Trivial fix to IPv6 in wget
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <bp009@terran.org>
List: pkgsrc-bugs
Date: 02/08/2005 02:17:00
>Number:         29279
>Category:       pkg
>Synopsis:       Strange behavior from wget on IPv6 addresses
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 08 02:17:00 +0000 2005
>Originator:     Bryan J. Phillippe
>Release:        NetBSD 1.6.2_STABLE - NetBSD-current
>Organization:
-bp
--
>Environment:
System: NetBSD jupiter 1.6.2_STABLE NetBSD 1.6.2_STABLE (jupiter 20030804) #7: Sat May 15 08:34:21 PDT 2004 bryan@jupiter:/usr/home/bryan/etc/src/NetBSD/1.6/src/sys/arch/alpha/compile/jupiter alpha
Architecture: alpha
Machine: alpha
>Description:
	wget uses an uninitialized struct sockaddr for networking.  For
	IPv4 this probably doesn't cause much trouble, but for IPv6 it
	can result in DAD occuring (~6 sec) before connect() returns (and
	possibly other more sinister problems).
>How-To-Repeat:
	Connect to an IPv6 address with wget and observe the delay and DAD
	activity on the wire via tcpdump.
>Fix:
--- host.c.orig	2005-02-07 17:55:35.000000000 -0800
+++ host.c	2005-02-07 17:55:49.000000000 -0800
@@ -286,6 +286,8 @@
 wget_sockaddr_set_address (wget_sockaddr *sa, 
 			   unsigned short port, ip_address *addr, int family)
 {
+  memset (sa, 0, sizeof(*sa));
+
   if (family == AF_INET)
     {
       sa->sin.sin_family = AF_INET;