summaryrefslogtreecommitdiff
path: root/dispatch.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 15:00:19 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 15:00:19 +1100
commit278f907a2d6d00d6f52a11bf9577648aadbf0994 (patch)
tree50f885a7fd73b813754e3b675e810dc01ba78b78 /dispatch.c
parente737856350287104a12f5a97c81fad1f7bcd7096 (diff)
downloadopenssh-git-278f907a2d6d00d6f52a11bf9577648aadbf0994.tar.gz
- 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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/dispatch.c b/dispatch.c
index 64873d53..036c0aaa 100644
--- a/dispatch.c
+++ b/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)