X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/84082b35b185e6ff69a58c882e89020ae5ca3021..ac381e055bf6c0016b5e0246cf30378209f11233:/l2tpns.c diff --git a/l2tpns.c b/l2tpns.c index 152c8ec..5947561 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -2716,7 +2716,14 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu result = 2; // general error error = 3; // reserved field non-zero msg = 0; - continue; // next + if (n == 0) + { + // if continue a infinity loop is created. + LOG(1, s, t, "It's infinite loop protection %02X\n", *b); + return; + } + else + continue; // next } b += 2; if (*(uint16_t *) (b)) @@ -2726,7 +2733,14 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu result = 2; // general error error = 6; // generic vendor-specific error msg = "unsupported vendor-specific"; - continue; // next + if (n == 0) + { + // if continue a infinity loop is created. + LOG(1, s, t, "It's infinite loop protection %02X\n", *b); + return; + } + else + continue; // next } b += 2; mtype = ntohs(*(uint16_t *) (b));