diff --git a/include/xdp/parsing_helpers.h b/include/xdp/parsing_helpers.h index de6705b..34e1caa 100644 --- a/include/xdp/parsing_helpers.h +++ b/include/xdp/parsing_helpers.h @@ -202,7 +202,7 @@ static __always_inline int parse_iphdr(struct hdr_cursor *nh, hdrsize = iph->ihl * 4; /* Sanity check packet field is valid */ - if(hdrsize < sizeof(iph)) + if(hdrsize < sizeof(*iph)) return -1; /* Variable-length IPv4 header, need to use byte-based arithmetic */ @@ -298,7 +298,7 @@ static __always_inline int parse_tcphdr(struct hdr_cursor *nh, len = h->doff * 4; /* Sanity check packet field is valid */ - if(len < sizeof(h)) + if(len < sizeof(*h)) return -1; /* Variable-length TCP header, need to use byte-based arithmetic */