diff options
author | Damien Miller <djm@mindrot.org> | 2001-12-21 15:00:19 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-12-21 15:00:19 +1100 |
commit | 278f907a2d6d00d6f52a11bf9577648aadbf0994 (patch) | |
tree | 50f885a7fd73b813754e3b675e810dc01ba78b78 /dispatch.c | |
parent | e737856350287104a12f5a97c81fad1f7bcd7096 (diff) |
- djm@cvs.openbsd.org 2001/12/20 22:50:24
[auth2.c auth2-chall.c channels.c channels.h clientloop.c dispatch.c]
[dispatch.h kex.c kex.h packet.c packet.h serverloop.c ssh.c]
[sshconnect2.c]
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 'dispatch.c')
-rw-r--r-- | dispatch.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dispatch.c b/dispatch.c index 64873d53a..036c0aaa5 100644 --- a/dispatch.c +++ b/dispatch.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 23 | */ |
24 | #include "includes.h" | 24 | #include "includes.h" |
25 | RCSID("$OpenBSD: dispatch.c,v 1.11 2001/06/10 11:29:20 markus Exp $"); | 25 | RCSID("$OpenBSD: dispatch.c,v 1.12 2001/12/20 22:50:24 djm Exp $"); |
26 | 26 | ||
27 | #include "ssh1.h" | 27 | #include "ssh1.h" |
28 | #include "ssh2.h" | 28 | #include "ssh2.h" |
@@ -37,9 +37,10 @@ RCSID("$OpenBSD: dispatch.c,v 1.11 2001/06/10 11:29:20 markus Exp $"); | |||
37 | dispatch_fn *dispatch[DISPATCH_MAX]; | 37 | dispatch_fn *dispatch[DISPATCH_MAX]; |
38 | 38 | ||
39 | void | 39 | void |
40 | dispatch_protocol_error(int type, int plen, void *ctxt) | 40 | dispatch_protocol_error(int type, int plen, u_int32_t seq, void *ctxt) |
41 | { | 41 | { |
42 | fatal("dispatch_protocol_error: type %d plen %d", type, plen); | 42 | fatal("dispatch_protocol_error: type %d seq %u plen %d", type, |
43 | seq, plen); | ||
43 | } | 44 | } |
44 | void | 45 | void |
45 | dispatch_init(dispatch_fn *dflt) | 46 | dispatch_init(dispatch_fn *dflt) |
@@ -59,16 +60,17 @@ dispatch_run(int mode, int *done, void *ctxt) | |||
59 | for (;;) { | 60 | for (;;) { |
60 | int plen; | 61 | int plen; |
61 | int type; | 62 | int type; |
63 | u_int32_t seqnr; | ||
62 | 64 | ||
63 | if (mode == DISPATCH_BLOCK) { | 65 | if (mode == DISPATCH_BLOCK) { |
64 | type = packet_read(&plen); | 66 | type = packet_read_seqnr(&plen, &seqnr); |
65 | } else { | 67 | } else { |
66 | type = packet_read_poll(&plen); | 68 | type = packet_read_poll_seqnr(&plen, &seqnr); |
67 | if (type == SSH_MSG_NONE) | 69 | if (type == SSH_MSG_NONE) |
68 | return; | 70 | return; |
69 | } | 71 | } |
70 | if (type > 0 && type < DISPATCH_MAX && dispatch[type] != NULL) | 72 | if (type > 0 && type < DISPATCH_MAX && dispatch[type] != NULL) |
71 | (*dispatch[type])(type, plen, ctxt); | 73 | (*dispatch[type])(type, plen, seqnr, ctxt); |
72 | else | 74 | else |
73 | packet_disconnect("protocol error: rcvd type %d", type); | 75 | packet_disconnect("protocol error: rcvd type %d", type); |
74 | if (done != NULL && *done) | 76 | if (done != NULL && *done) |