Index: pluto/demux.c =================================================================== RCS file: /cvs/freeswan/freeswan/pluto/demux.c,v retrieving revision 1.19 diff -u -r1.19 demux.c --- pluto/demux.c 26 Apr 2003 02:27:17 -0000 1.19 +++ pluto/demux.c 2 May 2003 19:49:03 -0000 @@ -1657,7 +1657,23 @@ while (np != ISAKMP_NEXT_NONE) { - struct_desc *sd = np < ISAKMP_NEXT_ROOF? payload_descs[np] : NULL; + struct_desc *sd; + +#ifndef NO_MSL2TP_HACK + /* + * jjo: very ugly M$L2TP hack... + * + * sometimes M$L2TP sends ISAKMP_NEXT_VID instead of + * ISAKMP_NEXT_NONE in last payload + */ + if (np == ISAKMP_NEXT_VID && md->message_pbs.roof == md->message_pbs.cur) { + loglog(RC_LOG_SERIOUS, "PAYLOAD_MALFORMED: peer specified ISAKMP_NEXT_VID instead of ISAKMP_NEXT_NONE in last payload: MSL2TP_HACK enabled"); + np = ISAKMP_NEXT_NONE; + break; + } +#endif + + sd = np < ISAKMP_NEXT_ROOF? payload_descs[np] : NULL; if (pd == &md->digest[PAYLIMIT]) { Index: pluto/packet.c =================================================================== RCS file: /cvs/freeswan/freeswan/pluto/packet.c,v retrieving revision 1.4 diff -u -r1.4 packet.c --- pluto/packet.c 2 Jan 2003 22:17:58 -0000 1.4 +++ pluto/packet.c 2 May 2003 19:49:03 -0000 @@ -739,7 +739,9 @@ u_int8_t *cur = ins->cur; if (ins->roof - cur < (ptrdiff_t)sd->size) { - ugh = builddiag("not enough room in input packet for %s", sd->name); + ugh = builddiag("not enough room in input packet for %s" + " (remain=%d, sd->size=%d)" + , sd->name, ins->roof - cur, sd->size); } else { u_int8_t *roof = cur + sd->size; /* may be changed by a length field */ u_int8_t *outp = struct_ptr;