Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

nfqws2: check ip version=4

This commit is contained in:
bol-van
2026-02-03 15:58:08 +03:00
parent 56cce72dac
commit 79b018dd74

View File

@@ -374,6 +374,7 @@ void print_icmphdr(const struct icmp46 *icmp, bool v6)
bool proto_check_ipv4(const uint8_t *data, size_t len)
{
if (len < sizeof(struct ip)) return false;
if (((struct ip*)data)->ip_v!=4) return false;
uint8_t off = ((struct ip*)data)->ip_hl << 2;
return off>=sizeof(struct ip) && len>=off;
}