diff options
author | Damien Miller <djm@mindrot.org> | 2009-01-28 16:31:22 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2009-01-28 16:31:22 +1100 |
commit | 3dc71ad8653bab5591fc75bb1d3e6aa8fb9360df (patch) | |
tree | c41a8152c222b8bebb63d9d9185e8a160b71a5a0 /clientloop.c | |
parent | 9576ac4afc7124415183dd9fe73d410165dbfe82 (diff) |
- djm@cvs.openbsd.org 2009/01/22 10:02:34
[clientloop.c misc.c readconf.c readconf.h servconf.c servconf.h]
[serverloop.c ssh-keyscan.c ssh.c sshd.c]
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 'clientloop.c')
-rw-r--r-- | clientloop.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clientloop.c b/clientloop.c index fdeedc351..1b5badb71 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.207 2008/12/09 22:37:33 stevesk Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.208 2009/01/22 10:02:34 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 |
@@ -765,7 +765,7 @@ process_cmdline(void) | |||
765 | char *s, *cmd, *cancel_host; | 765 | char *s, *cmd, *cancel_host; |
766 | int delete = 0; | 766 | int delete = 0; |
767 | int local = 0, remote = 0, dynamic = 0; | 767 | int local = 0, remote = 0, dynamic = 0; |
768 | u_short cancel_port; | 768 | int cancel_port; |
769 | Forward fwd; | 769 | Forward fwd; |
770 | 770 | ||
771 | bzero(&fwd, sizeof(fwd)); | 771 | bzero(&fwd, sizeof(fwd)); |
@@ -843,7 +843,7 @@ process_cmdline(void) | |||
843 | cancel_port = a2port(cancel_host); | 843 | cancel_port = a2port(cancel_host); |
844 | cancel_host = NULL; | 844 | cancel_host = NULL; |
845 | } | 845 | } |
846 | if (cancel_port == 0) { | 846 | if (cancel_port <= 0) { |
847 | logit("Bad forwarding close port"); | 847 | logit("Bad forwarding close port"); |
848 | goto out; | 848 | goto out; |
849 | } | 849 | } |
@@ -1638,7 +1638,7 @@ client_request_forwarded_tcpip(const char *request_type, int rchan) | |||
1638 | { | 1638 | { |
1639 | Channel *c = NULL; | 1639 | Channel *c = NULL; |
1640 | char *listen_address, *originator_address; | 1640 | char *listen_address, *originator_address; |
1641 | int listen_port, originator_port; | 1641 | u_short listen_port, originator_port; |
1642 | 1642 | ||
1643 | /* Get rest of the packet */ | 1643 | /* Get rest of the packet */ |
1644 | listen_address = packet_get_string(NULL); | 1644 | listen_address = packet_get_string(NULL); |
@@ -1664,7 +1664,7 @@ client_request_x11(const char *request_type, int rchan) | |||
1664 | { | 1664 | { |
1665 | Channel *c = NULL; | 1665 | Channel *c = NULL; |
1666 | char *originator; | 1666 | char *originator; |
1667 | int originator_port; | 1667 | u_short originator_port; |
1668 | int sock; | 1668 | int sock; |
1669 | 1669 | ||
1670 | if (!options.forward_x11) { | 1670 | if (!options.forward_x11) { |