bugfix: ipv4_hdr_get_frag_offset

This commit is contained in:
luwenpeng
2024-02-01 15:46:43 +08:00
parent 97ef872d9a
commit 3bbb341280

View File

@@ -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)