Code question (canohost.c)

Ben Lindstrom mouring at etoh.eviladmin.org
Fri Apr 30 12:24:36 EST 2004



On Fri, 30 Apr 2004, YOSHIFUJI Hideaki / [iso-2022-jp] 吉藤英明 wrote:

> In article <Pine.BSO.4.44.0404292059520.953-100000 at etoh.eviladmin.org> (at Thu, 29 Apr 2004 21:00:26 -0500 (CDT)), Ben Lindstrom <mouring at etoh.eviladmin.org> says:
>
> > Be that true.. then one should review the usage of it in sshconnect.c
> > which is the other place we do it.
>
> This (in sshconnect.c) should leave as "0"
> since options.bind_address may be NULL.
> (Note: host and/or port must non-NULL.)
>

 Tell me how options.bind_address can reach getaddrinfo() as null. As I
see it there is no possible way it can happen.

[..]
      /* Bind the socket to an alternative local IP address */
        if (options.bind_address == NULL)
                return sock;

        memset(&hints, 0, sizeof(hints));
        hints.ai_family = ai->ai_family;
        hints.ai_socktype = ai->ai_socktype;
        hints.ai_protocol = ai->ai_protocol;
        hints.ai_flags = AI_PASSIVE;
        gaierr = getaddrinfo(options.bind_address, "0", &hints, &res);
[..]


- Ben




More information about the openssh-unix-dev mailing list