mirror of
https://github.com/bol-van/zapret2.git
synced 2026-10-29 06:02:05 +00:00
nfqws2: check ip version=4
This commit is contained in:
1 parent
56cce72dac
commit
79b018dd74
1 file changed
+1
@@ -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