Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zftp does not work
- X-seq: zsh-workers 14916
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "ZSH Workers Mailing List" <zsh-workers@xxxxxxxxxx>
- Subject: zftp does not work
- Date: Thu, 14 Jun 2001 14:20:02 +0400
- Importance: Normal
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
I do not when it happened; I guess I have not tried zftp for a long time.
bor@itsrm2% zftp open localhost
zftp open: address length mismatch
zftp open: connect failed: invalid argument
in tcp.c (zsh_getipnodebyname):
if(zsh_inet_pton(af, name, nbuf) == 1) {
zsh_inet_ntop(af, nbuf, pbuf, sizeof(pbuf));
ahe.h_name = pbuf;
ahe.h_aliases = addrlist+1;
ahe.h_addrtype = af;
ahe.h_length = (af == AF_INET) ? 4 : 16;
ahe.h_addr_list = addrlist;
return &ahe;
}
he = zsh_gethostbyname2(name, af);
zsh_inet_pton here finally does
return (dst->s_addr = inet_addr(src)) != INADDR_NONE;
i.e. it returns 1 and h_length is set to 4; and later in zftp.c:
salen = sizeof(struct sockaddr_in);
...
if(salen != zhostp->h_length)
zwarnnam(name, "address length mismatch", NULL, 0);
But struct sockaddr_in is
struct sockaddr_in {
sa_family_t sin_family;
ushort_t sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
and in no case can be 4.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author