- 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@
diff --git a/clientloop.c b/clientloop.c
index fdeedc3..1b5badb 100644
--- a/clientloop.c
+++ b/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
@@ -765,7 +765,7 @@
 	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));
@@ -843,7 +843,7 @@
 			cancel_port = a2port(cancel_host);
 			cancel_host = NULL;
 		}
-		if (cancel_port == 0) {
+		if (cancel_port <= 0) {
 			logit("Bad forwarding close port");
 			goto out;
 		}
@@ -1638,7 +1638,7 @@
 {
 	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);
@@ -1664,7 +1664,7 @@
 {
 	Channel *c = NULL;
 	char *originator;
-	int originator_port;
+	u_short originator_port;
 	int sock;
 
 	if (!options.forward_x11) {