zsh-workers
 help / color / mirror / code / Atom feed
* zftp does not work
@ 2001-06-14 10:20 Andrej Borsenkow
  2001-06-14 17:47 ` Mads Martin Jørgensen
  2001-06-15 12:55 ` Andrej Borsenkow
  0 siblings, 2 replies; 5+ messages in thread
From: Andrej Borsenkow @ 2001-06-14 10:20 UTC (permalink / raw)
  To: ZSH Workers Mailing List

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-06-15 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-14 10:20 zftp does not work Andrej Borsenkow
2001-06-14 17:47 ` Mads Martin Jørgensen
2001-06-14 18:47   ` Peter Stephenson
2001-06-14 19:53     ` Peter Stephenson
2001-06-15 12:55 ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).