about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-04-25 14:06:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-04-25 14:06:47 +0000
commit421123b0f0fca3439ea84f850e07b6d452d8c04d (patch)
tree97021088f7a1d3eea187c98f0b3d148dcfedc0dc /Src/Modules
parentf630c8abf4844dfcb84a21ec558f3c28726312ca (diff)
downloadzsh-421123b0f0fca3439ea84f850e07b6d452d8c04d.tar.gz
zsh-421123b0f0fca3439ea84f850e07b6d452d8c04d.tar.xz
zsh-421123b0f0fca3439ea84f850e07b6d452d8c04d.zip
17040: Src/Modules/tcp.c: AF_INET6 wasn't copied into the
socket structure for IPv6.
17041: Src/Modules/zftp.c: Minor but fatal typos creating a data
connection for zftp using IPv6.
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/tcp.c3
-rw-r--r--Src/Modules/zftp.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c
index eb4685b39..5f5f432c6 100644
--- a/Src/Modules/tcp.c
+++ b/Src/Modules/tcp.c
@@ -322,13 +322,14 @@ tcp_connect(Tcp_session sess, char *addrp, struct hostent *zhost, int d_port)
 # ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
 	sess->peer.in6.sin6_scope_id = 0;
 # endif
+	sess->peer.in6.sin6_family = zhost->h_addrtype;
 	salen = sizeof(struct sockaddr_in6);
     } else
 #endif /* SUPPORT_IPV6 */
     {
 	memcpy(&(sess->peer.in.sin_addr), addrp, zhost->h_length);
 	sess->peer.in.sin_port = d_port;
-	sess->peer.a.sa_family = zhost->h_addrtype;
+	sess->peer.in.sin_family = zhost->h_addrtype;
 	salen = sizeof(struct sockaddr_in);
     }
 
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 6ee0f0156..80e09045c 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -863,7 +863,7 @@ zfopendata(char *name, union tcp_sockaddr *zdsockp, int *is_passivep)
 	zwarnnam(name, "Must set preference S or P to transfer data", NULL, 0);
 	return 1;
     }
-    zfsess->dfd = socket(AF_INET, SOCK_STREAM, 0);
+    zfsess->dfd = socket(zfsess->control->peer.a.sa_family, SOCK_STREAM, 0);
     if (zfsess->dfd < 0) {
 	zwarnnam(name, "can't get data socket: %e", NULL, errno);
 	return 1;
@@ -907,7 +907,7 @@ zfopendata(char *name, union tcp_sockaddr *zdsockp, int *is_passivep)
 	    delim = ptr[1];
 	    if(delim < 33 || delim > 126 || ptr[2] != delim || ptr[3] != delim)
 		goto bad_epsv;
-	    ptr += 3;
+	    ptr += 4;
 	    end = strchr(ptr, delim);
 	    if(!end || end[1] != ')')
 		goto bad_epsv;