-/* $OpenBSD: clientloop.c,v 1.163 2006/05/16 09:00:00 markus 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"
if (*s == 'h' || *s == 'H' || *s == '?') {
logit("Commands:");
- logit(" -Lport:host:hostport Request local forward");
- logit(" -Rport:host:hostport Request remote forward");
- logit(" -KRhostport Cancel remote forward");
+ logit(" -L[bind_address:]port:host:hostport "
+ "Request local forward");
+ logit(" -R[bind_address:]port:host:hostport "
+ "Request remote forward");
+ logit(" -KR[bind_address:]port "
+ "Cancel remote forward");
if (!options.permit_local_command)
goto out;
- logit(" !args Execute local command");
+ logit(" !args "
+ "Execute 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.");