From 3bbb341280c557d8978d326a0cc0b3e9fcab4337 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Thu, 1 Feb 2024 15:46:43 +0800 Subject: [PATCH] bugfix: ipv4_hdr_get_frag_offset --- src/packet/ipv4_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packet/ipv4_helpers.h b/src/packet/ipv4_helpers.h index c0d440d..e8e5671 100644 --- a/src/packet/ipv4_helpers.h +++ b/src/packet/ipv4_helpers.h @@ -76,7 +76,7 @@ static inline bool ipv4_hdr_has_flag_mf(const struct ip *hdr) static inline uint16_t ipv4_hdr_get_frag_offset(const struct ip *hdr) { - return ntohs(hdr->ip_off) & IP_OFFMASK; + return (ntohs(hdr->ip_off) & IP_OFFMASK) << 3; } static inline uint8_t ipv4_hdr_get_ttl(const struct ip *hdr)