diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2009-01-22 10:02:35 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2009-01-22 10:02:35 +0000 |
commit | 0435102032a11e65c85556d97788aaa493e961c5 (patch) | |
tree | 427ca5c5b89340e1a6b64f29a1cdd06d754864f6 /usr.bin/ssh/readconf.c | |
parent | a0c3482df2bba2a7b24e534b155079910aed219d (diff) |
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/readconf.c')
-rw-r--r-- | usr.bin/ssh/readconf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 27387009f3c..963709e729f 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.174 2009/01/15 17:38:43 stevesk Exp $ */ +/* $OpenBSD: readconf.c,v 1.175 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 @@ -1274,11 +1274,11 @@ parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd) } else { if (!(i == 3 || i == 4)) goto fail_free; - if (fwd->connect_port == 0) + if (fwd->connect_port <= 0) goto fail_free; } - if (fwd->listen_port == 0) + if (fwd->listen_port <= 0) goto fail_free; if (fwd->connect_host != NULL && |