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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user