-/* $OpenBSD: clientloop.c,v 1.164 2006/06/26 10:36:15 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.169 2006/07/17 01:31:09 stevesk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
+#include <sys/socket.h>
#include <sys/ioctl.h>
#include <ctype.h>
+#include <errno.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
#include <signal.h>
#include <termios.h>
+#include <unistd.h>
#include "ssh.h"
#include "ssh1.h"
"Request local forward");
logit(" -R[bind_address:]port:host:hostport "
"Request remote forward");
- logit(" -KR[bind_address:]hostport "
+ logit(" -KR[bind_address:]port "
"Cancel remote forward");
if (!options.permit_local_command)
goto out;
goto out;
}
} else {
- channel_request_remote_forwarding(fwd.listen_host,
+ if (channel_request_remote_forwarding(fwd.listen_host,
fwd.listen_port, fwd.connect_host,
- fwd.connect_port);
+ fwd.connect_port) < 0) {
+ logit("Port forwarding failed.");
+ goto out;
+ }
}
logit("Forwarding port.");