diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2001-12-20 22:50:25 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2001-12-20 22:50:25 +0000 |
commit | 875417685ffbf9ef3667e81f8ec081b7b96d87cd (patch) | |
tree | d6f42453f78135d603cfc33f5025a66d6e000245 /usr.bin/ssh/dispatch.c | |
parent | 918eee0e34df8e238e143e796dfd151aac893609 (diff) |
Conformance fix: we should send failing packet sequence number when
responding with a SSH_MSG_UNIMPLEMENTED message. Spotted by
yakk@yakk.dot.net; ok markus@
Diffstat (limited to 'usr.bin/ssh/dispatch.c')
-rw-r--r-- | usr.bin/ssh/dispatch.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/ssh/dispatch.c b/usr.bin/ssh/dispatch.c index 64873d53a1d..036c0aaa5b3 100644 --- a/usr.bin/ssh/dispatch.c +++ b/usr.bin/ssh/dispatch.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: dispatch.c,v 1.11 2001/06/10 11:29:20 markus Exp $"); +RCSID("$OpenBSD: dispatch.c,v 1.12 2001/12/20 22:50:24 djm Exp $"); #include "ssh1.h" #include "ssh2.h" @@ -37,9 +37,10 @@ RCSID("$OpenBSD: dispatch.c,v 1.11 2001/06/10 11:29:20 markus Exp $"); dispatch_fn *dispatch[DISPATCH_MAX]; void -dispatch_protocol_error(int type, int plen, void *ctxt) +dispatch_protocol_error(int type, int plen, u_int32_t seq, void *ctxt) { - fatal("dispatch_protocol_error: type %d plen %d", type, plen); + fatal("dispatch_protocol_error: type %d seq %u plen %d", type, + seq, plen); } void dispatch_init(dispatch_fn *dflt) @@ -59,16 +60,17 @@ dispatch_run(int mode, int *done, void *ctxt) for (;;) { int plen; int type; + u_int32_t seqnr; if (mode == DISPATCH_BLOCK) { - type = packet_read(&plen); + type = packet_read_seqnr(&plen, &seqnr); } else { - type = packet_read_poll(&plen); + type = packet_read_poll_seqnr(&plen, &seqnr); if (type == SSH_MSG_NONE) return; } if (type > 0 && type < DISPATCH_MAX && dispatch[type] != NULL) - (*dispatch[type])(type, plen, ctxt); + (*dispatch[type])(type, plen, seqnr, ctxt); else packet_disconnect("protocol error: rcvd type %d", type); if (done != NULL && *done) |