Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-22 01:05:48 +00:00

nfqws2: check ipv6 plen

This commit is contained in:
bol-van
2026-01-14 19:13:46 +03:00
parent 10201f1abf
commit 9dd14dfc7c
3 changed files with 15 additions and 47 deletions

View File

@@ -1296,6 +1296,7 @@ void lua_pushf_ip6exthdr(lua_State *L, const struct ip6_hdr *ip6, size_t len)
// assume ipv6 packet structure was already checked for validity
size_t hdrlen;
uint8_t HeaderType, *data;
uint16_t plen;
lua_Integer idx = 1;
lua_pushliteral(L, "exthdr");
@@ -1305,6 +1306,8 @@ void lua_pushf_ip6exthdr(lua_State *L, const struct ip6_hdr *ip6, size_t len)
HeaderType = ip6->ip6_ctlun.ip6_un1.ip6_un1_nxt;
data=(uint8_t*)(ip6+1);
len-=sizeof(struct ip6_hdr);
plen = ntohs(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen);
if (plen < len) len = plen;
while (len > 0) // need at least one byte for NextHeader field
{
switch (HeaderType)