From 79b018dd74cf8a9f2a181ed2d45203a365104774 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 3 Feb 2026 15:58:08 +0300 Subject: [PATCH] nfqws2: check ip version=4 --- nfq2/darkmagic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nfq2/darkmagic.c b/nfq2/darkmagic.c index 2ca6d5a..a0b4ca8 100644 --- a/nfq2/darkmagic.c +++ b/nfq2/darkmagic.c @@ -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; }