// L2TPNS PPP Stuff
-char const *cvs_id_ppp = "$Id: ppp.c,v 1.82 2005-09-16 05:04:29 bodea Exp $";
+char const *cvs_id_ppp = "$Id: ppp.c,v 1.84 2005-09-16 13:20:39 bodea Exp $";
#include <stdio.h>
#include <string.h>
*q = CodeRej;
*(q + 1) = ++sess_local[s].lcp_ident;
- *(uint16_t *)(q + 2) = l;
+ *(uint16_t *)(q + 2) = htons(l);
memcpy(q + 4, p, l - 4);
LOG(2, s, t, "Unexpected %s code %s\n", pname, ppp_code(*p));
LOG_HEX(5, "IP", p, l);
- if (l < 20 || l < ntohl(*(uint32_t *)(p + 2)))
+ if (l < 20)
{
LOG(1, s, t, "IP packet too short %d\n", l);
STAT(tunnel_rx_errors);