diff options
Diffstat (limited to 'include/net/eth.h')
-rw-r--r-- | include/net/eth.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/eth.h b/include/net/eth.h index 09054a506d..e6dc8a7ba0 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -194,7 +194,9 @@ struct tcp_hdr { #define PKT_GET_IP_HDR(p) \ ((struct ip_header *)(((uint8_t *)(p)) + eth_get_l2_hdr_length(p))) #define IP_HDR_GET_LEN(p) \ - ((((struct ip_header *)(p))->ip_ver_len & 0x0F) << 2) + ((ldub_p(p + offsetof(struct ip_header, ip_ver_len)) & 0x0F) << 2) +#define IP_HDR_GET_P(p) \ + (ldub_p(p + offsetof(struct ip_header, ip_p))) #define PKT_GET_IP_HDR_LEN(p) \ (IP_HDR_GET_LEN(PKT_GET_IP_HDR(p))) #define PKT_GET_IP6_HDR(p) \ |