diff options
author | 2009-01-22 10:02:34 +0000 | |
---|---|---|
committer | 2009-01-22 10:02:34 +0000 | |
commit | a10ba8e0d42f8de2c7e5b81cac0336819d636310 (patch) | |
tree | cf85b99b29b096fb5939ba93f194d90b5b10dd35 /usr.bin/ssh/clientloop.c | |
parent | oops! I committed the wrong version of the Channel->path diff, (diff) | |
download | wireguard-openbsd-a10ba8e0d42f8de2c7e5b81cac0336819d636310.tar.xz wireguard-openbsd-a10ba8e0d42f8de2c7e5b81cac0336819d636310.zip |
make a2port() return -1 when it encounters an invalid port number
rather than 0, which it will now treat as valid (needed for future work)
adjust current consumers of a2port() to check its return value is <= 0,
which in turn required some things to be converted from u_short => int
make use of int vs. u_short consistent in some other places too
feedback & ok markus@
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 1b67dae3aaf..eeaba5274f5 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.207 2008/12/09 22:37:33 stevesk Exp $ */ +/* $OpenBSD: clientloop.c,v 1.208 2009/01/22 10:02:34 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -756,7 +756,7 @@ process_cmdline(void) char *s, *cmd, *cancel_host; int delete = 0; int local = 0, remote = 0, dynamic = 0; - u_short cancel_port; + int cancel_port; Forward fwd; bzero(&fwd, sizeof(fwd)); @@ -834,7 +834,7 @@ process_cmdline(void) cancel_port = a2port(cancel_host); cancel_host = NULL; } - if (cancel_port == 0) { + if (cancel_port <= 0) { logit("Bad forwarding close port"); goto out; } @@ -1626,7 +1626,7 @@ client_request_forwarded_tcpip(const char *request_type, int rchan) { Channel *c = NULL; char *listen_address, *originator_address; - int listen_port, originator_port; + u_short listen_port, originator_port; /* Get rest of the packet */ listen_address = packet_get_string(NULL); @@ -1652,7 +1652,7 @@ client_request_x11(const char *request_type, int rchan) { Channel *c = NULL; char *originator; - int originator_port; + u_short originator_port; int sock; if (!options.forward_x11) { |