version 1.270.2.1, 2008/04/03 03:41:40 |
version 1.271, 2007/12/27 14:22:08 |
|
|
if (addr == NULL) { |
if (addr == NULL) { |
/* This really shouldn't happen */ |
/* This really shouldn't happen */ |
packet_disconnect("getaddrinfo: fatal error: %s", |
packet_disconnect("getaddrinfo: fatal error: %s", |
gai_strerror(r)); |
ssh_gai_strerror(r)); |
} else { |
} else { |
error("channel_setup_fwd_listener: " |
error("channel_setup_fwd_listener: " |
"getaddrinfo(%.64s): %s", addr, gai_strerror(r)); |
"getaddrinfo(%.64s): %s", addr, |
|
ssh_gai_strerror(r)); |
} |
} |
return 0; |
return 0; |
} |
} |
|
|
snprintf(strport, sizeof strport, "%d", port); |
snprintf(strport, sizeof strport, "%d", port); |
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) { |
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) { |
error("connect_to %.100s: unknown host (%s)", host, |
error("connect_to %.100s: unknown host (%s)", host, |
gai_strerror(gaierr)); |
ssh_gai_strerror(gaierr)); |
return -1; |
return -1; |
} |
} |
for (ai = aitop; ai; ai = ai->ai_next) { |
for (ai = aitop; ai; ai = ai->ai_next) { |
|
|
hints.ai_socktype = SOCK_STREAM; |
hints.ai_socktype = SOCK_STREAM; |
snprintf(strport, sizeof strport, "%d", port); |
snprintf(strport, sizeof strport, "%d", port); |
if ((gaierr = getaddrinfo(NULL, strport, &hints, &aitop)) != 0) { |
if ((gaierr = getaddrinfo(NULL, strport, &hints, &aitop)) != 0) { |
error("getaddrinfo: %.100s", gai_strerror(gaierr)); |
error("getaddrinfo: %.100s", ssh_gai_strerror(gaierr)); |
return -1; |
return -1; |
} |
} |
for (ai = aitop; ai; ai = ai->ai_next) { |
for (ai = aitop; ai; ai = ai->ai_next) { |
|
|
debug2("bind port %d: %.100s", port, strerror(errno)); |
debug2("bind port %d: %.100s", port, strerror(errno)); |
close(sock); |
close(sock); |
|
|
|
if (ai->ai_next) |
|
continue; |
|
|
for (n = 0; n < num_socks; n++) { |
for (n = 0; n < num_socks; n++) { |
close(socks[n]); |
close(socks[n]); |
} |
} |
|
|
hints.ai_socktype = SOCK_STREAM; |
hints.ai_socktype = SOCK_STREAM; |
snprintf(strport, sizeof strport, "%u", 6000 + display_number); |
snprintf(strport, sizeof strport, "%u", 6000 + display_number); |
if ((gaierr = getaddrinfo(buf, strport, &hints, &aitop)) != 0) { |
if ((gaierr = getaddrinfo(buf, strport, &hints, &aitop)) != 0) { |
error("%.100s: unknown host. (%s)", buf, gai_strerror(gaierr)); |
error("%.100s: unknown host. (%s)", buf, |
|
ssh_gai_strerror(gaierr)); |
return -1; |
return -1; |
} |
} |
for (ai = aitop; ai; ai = ai->ai_next) { |
for (ai = aitop; ai; ai = ai->ai_next) { |