summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/serverloop.c b/serverloop.c
index 20991c3ce..2142f3809 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.149 2008/05/08 12:02:23 djm Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.150 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
@@ -938,7 +938,6 @@ static Channel *
938server_request_direct_tcpip(void) 938server_request_direct_tcpip(void)
939{ 939{
940 Channel *c; 940 Channel *c;
941 int sock;
942 char *target, *originator; 941 char *target, *originator;
943 int target_port, originator_port; 942 int target_port, originator_port;
944 943
@@ -948,18 +947,16 @@ server_request_direct_tcpip(void)
948 originator_port = packet_get_int(); 947 originator_port = packet_get_int();
949 packet_check_eom(); 948 packet_check_eom();
950 949
951 debug("server_request_direct_tcpip: originator %s port %d, target %s port %d", 950 debug("server_request_direct_tcpip: originator %s port %d, target %s "
952 originator, originator_port, target, target_port); 951 "port %d", originator, originator_port, target, target_port);
953 952
954 /* XXX check permission */ 953 /* XXX check permission */
955 sock = channel_connect_to(target, target_port); 954 c = channel_connect_to(target, target_port,
956 xfree(target); 955 "direct-tcpip", "direct-tcpip");
956
957 xfree(originator); 957 xfree(originator);
958 if (sock < 0) 958 xfree(target);
959 return NULL; 959
960 c = channel_new("direct-tcpip", SSH_CHANNEL_CONNECTING,
961 sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT,
962 CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1);
963 return c; 960 return c;
964} 961}
965 962