SOURCES: lftp-ipv6.patch (NEW) - fix connections on link-local ipv6 addresses

arekm arekm at pld-linux.org
Tue Jan 27 14:51:50 CET 2009


Author: arekm                        Date: Tue Jan 27 13:51:50 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix connections on link-local ipv6 addresses

---- Files affected:
SOURCES:
   lftp-ipv6.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/lftp-ipv6.patch
diff -u /dev/null SOURCES/lftp-ipv6.patch:1.1
--- /dev/null	Tue Jan 27 14:51:51 2009
+++ SOURCES/lftp-ipv6.patch	Tue Jan 27 14:51:44 2009
@@ -0,0 +1,70 @@
+diff -ur lftp-3.7.8.org/src/Resolver.cc lftp-3.7.8/src/Resolver.cc
+--- lftp-3.7.8.org/src/Resolver.cc	2008-11-27 06:56:26.000000000 +0100
++++ lftp-3.7.8/src/Resolver.cc	2009-01-27 14:47:57.466736403 +0100
+@@ -291,7 +291,7 @@
+    done=true;
+ }
+ 
+-void Resolver::AddAddress(int family,const char *address,int len)
++void Resolver::AddAddress(int family,const char *address,int len, unsigned int scope)
+ {
+    sockaddr_u add;
+    memset(&add,0,sizeof(add));
+@@ -315,6 +315,7 @@
+          return;
+       memcpy(&add.in6.sin6_addr,address,len);
+       add.in6.sin6_port=port_number;
++      add.in6.sin6_scope_id=scope;
+ #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+       add.sa.sa_len=sizeof(add.in6);
+ #endif
+@@ -693,6 +694,7 @@
+       struct sockaddr_in6   *inet6_addr;
+       const char	    *addr_data;
+       int		    addr_len;
++      unsigned int          addr_scope;
+ 
+       memset(&a_hint, 0, sizeof(a_hint));
+       a_hint.ai_flags	    = AI_PASSIVE;
+@@ -717,17 +719,19 @@
+ 	       case AF_INET:
+ 		  inet_addr   = (sockaddr_in *)sockname;
+ 		  addr_data   = (const char *)&(inet_addr->sin_addr.s_addr);
++		  addr_scope  = 0;
+ 		  addr_len    = sizeof(inet_addr->sin_addr.s_addr);
+ 		  break;
+ 	       case AF_INET6:
+ 		  inet6_addr  = (sockaddr_in6 *)sockname;
+ 		  addr_data   = (const char *)&(inet6_addr->sin6_addr.s6_addr);
++		  addr_scope  = inet6_addr->sin6_scope_id;
+ 		  addr_len    = sizeof(inet6_addr->sin6_addr.s6_addr);
+ 		  break;
+ 	       default:
+ 		  continue;
+ 	       }
+-	       AddAddress(a_res->ai_family, addr_data, addr_len);
++	       AddAddress(a_res->ai_family, addr_data, addr_len, addr_scope);
+ 	    }
+ 	 }
+ 
+@@ -773,7 +777,7 @@
+       {
+ 	 const char * const *a;
+ 	 for(a=ha->h_addr_list; *a; a++)
+-	    AddAddress(ha->h_addrtype, *a, ha->h_length);
++	    AddAddress(ha->h_addrtype, *a, ha->h_length, 0);
+ 	 retries=0;
+ 	 af_index++;
+ # if defined(HAVE_GETIPNODEBYNAME)
+diff -ur lftp-3.7.8.org/src/Resolver.h lftp-3.7.8/src/Resolver.h
+--- lftp-3.7.8.org/src/Resolver.h	2008-11-27 06:56:27.000000000 +0100
++++ lftp-3.7.8/src/Resolver.h	2009-01-27 14:47:12.017783307 +0100
+@@ -47,7 +47,7 @@
+ 
+    xarray<sockaddr_u> addr;
+ 
+-   void AddAddress(int family,const char *a,int len);
++   void AddAddress(int family,const char *a,int len,unsigned int scope);
+ 
+    xstring err_msg;
+    bool done;
================================================================


More information about the pld-cvs-commit mailing list