From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21072 invoked from network); 15 Jun 2001 12:55:34 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Jun 2001 12:55:34 -0000 Received: (qmail 23365 invoked by alias); 15 Jun 2001 12:55:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14931 Received: (qmail 23336 invoked from network); 15 Jun 2001 12:55:02 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "ZSH Workers Mailing List" Subject: RE: zftp does not work Date: Fri, 15 Jun 2001 16:55:24 +0400 Message-ID: <003c01c0f59a$7196a280$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_003D_01C0F5BB.F8A84280" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <000a01c0f4bb$92f9f3d0$21c9ca95@mow.siemens.ru> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal This is a multi-part message in MIME format. ------=_NextPart_000_003D_01C0F5BB.F8A84280 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit > > bor@itsrm2% zftp open localhost > zftp open: address length mismatch > zftp open: connect failed: invalid argument > I am not exactly sure why we want to check it, but at least let's do it te right way. The len parameter in tcp_connect was wrong as well. -andrej ------=_NextPart_000_003D_01C0F5BB.F8A84280 Content-Type: application/octet-stream; name="zsh-tcp.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zsh-tcp.diff" Index: Src/Modules/zftp.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v=0A= retrieving revision 1.16=0A= diff -u -r1.16 zftp.c=0A= --- Src/Modules/zftp.c 2001/06/12 15:57:26 1.16=0A= +++ Src/Modules/zftp.c 2001/06/15 12:54:11=0A= @@ -1699,7 +1699,7 @@=0A= struct hostent *zhostp =3D NULL;=0A= char **addrp, *fname;=0A= int err, len, tmout;=0A= - int herrno, af, salen;=0A= + int herrno, af, hlen;=0A= =0A= if (!*args) {=0A= if (zfsess->userparams)=0A= @@ -1777,11 +1777,11 @@=0A= zfsess->control.peer.a.sa_family =3D af;=0A= #ifdef SUPPORT_IPV6=0A= if(af =3D=3D AF_INET6) {=0A= - salen =3D sizeof(struct sockaddr_in6);=0A= + hlen =3D 16;=0A= } else=0A= #endif /* SUPPORT_IPV6 */=0A= {=0A= - salen =3D sizeof(struct sockaddr_in);=0A= + hlen =3D 4;=0A= }=0A= =0A= tcp_socket(af, SOCK_STREAM, 0, &(zfsess->control));=0A= @@ -1805,7 +1805,7 @@=0A= =0A= /* try all possible IP's */=0A= for (addrp =3D zhostp->h_addr_list; err && *addrp; addrp++) {=0A= - if(salen !=3D zhostp->h_length)=0A= + if(hlen !=3D zhostp->h_length)=0A= zwarnnam(name, "address length mismatch", NULL, 0);=0A= do {=0A= err =3D tcp_connect(&(zfsess->control), *addrp, zhostp, = zservp->s_port);=0A= Index: Src/Modules/tcp.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.c,v=0A= retrieving revision 1.3=0A= diff -u -r1.3 tcp.c=0A= --- Src/Modules/tcp.c 2001/06/12 15:57:26 1.3=0A= +++ Src/Modules/tcp.c 2001/06/15 12:54:11=0A= @@ -255,6 +255,7 @@=0A= mod_export int=0A= tcp_connect(Tcp_session sess, char *addrp, struct hostent *zhost, int = d_port)=0A= {=0A= + int salen;=0A= #ifdef SUPPORT_IPV6=0A= if(zhost->h_addrtype=3D=3DAF_INET6) {=0A= memcpy(&(sess->peer.in6.sin6_addr), addrp, zhost->h_length);=0A= @@ -263,14 +264,16 @@=0A= # ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID=0A= sess->peer.in6.sin6_scope_id =3D 0;=0A= # endif=0A= + salen =3D sizeof(struct sockaddr_in6);=0A= } else=0A= #endif /* SUPPORT_IPV6 */=0A= {=0A= memcpy(&(sess->peer.in.sin_addr), addrp, zhost->h_length);=0A= sess->peer.in.sin_port =3D d_port;=0A= + salen =3D sizeof(struct sockaddr_in);=0A= }=0A= =0A= - return connect(sess->fd, (struct sockaddr *)&(sess->peer), = zhost->h_length);=0A= + return connect(sess->fd, (struct sockaddr *)&(sess->peer), salen);=0A= }=0A= =0A= /* The load/unload routines required by the zsh library interface */=0A= ------=_NextPart_000_003D_01C0F5BB.F8A84280--