diff options
author | Damien Miller <djm@mindrot.org> | 2008-05-19 15:37:09 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-05-19 15:37:09 +1000 |
commit | bd74025c7b08104828986d01e60f04372b3d5337 (patch) | |
tree | ba2d9b51b7e33e64f1c19b15f862b3929559506c /clientloop.c | |
parent | 5771ed7d1b5af26bc991151ab977e77bf1e87666 (diff) |
- djm@cvs.openbsd.org 2008/05/09 04:55:56
[channels.c channels.h clientloop.c serverloop.c]
Try additional addresses when connecting to a port forward destination
whose DNS name resolves to more than one address. The previous behaviour
was to try the first address and give up.
Reported by stig AT venaas.com in bz#343
great feedback and ok markus@
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/clientloop.c b/clientloop.c index c40f2c303..7bd1af60c 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.190 2008/05/08 13:06:10 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.191 2008/05/09 04:55:56 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1762,7 +1762,6 @@ client_request_forwarded_tcpip(const char *request_type, int rchan) | |||
1762 | Channel *c = NULL; | 1762 | Channel *c = NULL; |
1763 | char *listen_address, *originator_address; | 1763 | char *listen_address, *originator_address; |
1764 | int listen_port, originator_port; | 1764 | int listen_port, originator_port; |
1765 | int sock; | ||
1766 | 1765 | ||
1767 | /* Get rest of the packet */ | 1766 | /* Get rest of the packet */ |
1768 | listen_address = packet_get_string(NULL); | 1767 | listen_address = packet_get_string(NULL); |
@@ -1771,19 +1770,13 @@ client_request_forwarded_tcpip(const char *request_type, int rchan) | |||
1771 | originator_port = packet_get_int(); | 1770 | originator_port = packet_get_int(); |
1772 | packet_check_eom(); | 1771 | packet_check_eom(); |
1773 | 1772 | ||
1774 | debug("client_request_forwarded_tcpip: listen %s port %d, originator %s port %d", | 1773 | debug("client_request_forwarded_tcpip: listen %s port %d, " |
1775 | listen_address, listen_port, originator_address, originator_port); | 1774 | "originator %s port %d", listen_address, listen_port, |
1775 | originator_address, originator_port); | ||
1776 | |||
1777 | c = channel_connect_by_listen_address(listen_port, | ||
1778 | "forwarded-tcpip", originator_address); | ||
1776 | 1779 | ||
1777 | sock = channel_connect_by_listen_address(listen_port); | ||
1778 | if (sock < 0) { | ||
1779 | xfree(originator_address); | ||
1780 | xfree(listen_address); | ||
1781 | return NULL; | ||
1782 | } | ||
1783 | c = channel_new("forwarded-tcpip", | ||
1784 | SSH_CHANNEL_CONNECTING, sock, sock, -1, | ||
1785 | CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, | ||
1786 | originator_address, 1); | ||
1787 | xfree(originator_address); | 1780 | xfree(originator_address); |
1788 | xfree(listen_address); | 1781 | xfree(listen_address); |
1789 | return c; | 1782 | return c; |