X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/43196d65779c8408b66ce895e4e43f173da51026..a8823a7dfa876c1a6f4aca964ee3a49b690e153d:/ppp.c diff --git a/ppp.c b/ppp.c index abd5609..806880e 100644 --- a/ppp.c +++ b/ppp.c @@ -1,6 +1,6 @@ // L2TPNS PPP Stuff -char const *cvs_id_ppp = "$Id: ppp.c,v 1.77 2005-08-29 06:17:53 bodea Exp $"; +char const *cvs_id_ppp = "$Id: ppp.c,v 1.79 2005-08-31 12:41:09 bodea Exp $"; #include #include @@ -88,7 +88,7 @@ void processpap(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) if (session[s].ip || !(r = radiusnew(s))) { // respond now, either no RADIUS available or already authenticated - uint8_t b[MAXCONTROL]; + uint8_t b[MAXETHER]; uint8_t id = p[1]; uint8_t *p = makeppp(b, sizeof(b), 0, 0, s, t, PPPPAP); if (!p) return; @@ -447,7 +447,7 @@ static uint8_t *ppp_nak(sessionidt s, uint8_t *buf, size_t blen, uint16_t mtype, // Process LCP messages void processlcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) { - uint8_t b[MAXCONTROL]; + uint8_t b[MAXETHER]; uint8_t *q = NULL; uint32_t magicno = 0; uint16_t hl; @@ -866,7 +866,7 @@ void processlcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) { // Ignore it, last_packet time is set earlier than this. } - else + else if (*p != CodeRej) { int code = *p; int mru = session[s].mru; @@ -911,7 +911,7 @@ static void ipcp_open(sessionidt s, tunnelidt t) // Process IPCP messages void processipcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) { - uint8_t b[MAXCONTROL]; + uint8_t b[MAXETHER]; uint8_t *q = 0; uint16_t hl; @@ -1109,7 +1109,7 @@ void processipcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) tunnelsend(b, l + (q - b), t); change_state(s, ipcp, Stopped); } - else + else if (*p != CodeRej) { int code = *p; int mru = session[s].mru; @@ -1143,7 +1143,7 @@ static void ipv6cp_open(sessionidt s, tunnelidt t) // Process IPV6CP messages void processipv6cp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) { - uint8_t b[MAXCONTROL]; + uint8_t b[MAXETHER]; uint8_t *q = 0; uint16_t hl; @@ -1330,7 +1330,7 @@ void processipv6cp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) tunnelsend(b, l + (q - b), t); change_state(s, ipv6cp, Stopped); } - else + else if (*p != CodeRej) { int code = *p; int mru = session[s].mru; @@ -1575,7 +1575,7 @@ void send_ipin(sessionidt s, uint8_t *buf, int len) // Process CCP messages void processccp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) { - uint8_t b[MAXCONTROL]; + uint8_t b[MAXETHER]; uint8_t *q; CSTAT(processccp); @@ -1691,7 +1691,7 @@ void processccp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) tunnelsend(b, l + (q - b), t); change_state(s, ccp, Stopped); } - else + else if (*p != CodeRej) { int code = *p; int mru = session[s].mru; @@ -1713,7 +1713,7 @@ void processccp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) // send a CHAP challenge void sendchap(sessionidt s, tunnelidt t) { - uint8_t b[MAXCONTROL]; + uint8_t b[MAXETHER]; uint16_t r; uint8_t *q;