update IPv4 utils
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "packet.h"
|
||||
#include "udp_utils.h"
|
||||
#include "tcp_utils.h"
|
||||
#include "ipv4_utils.h"
|
||||
|
||||
#define likely(expr) __builtin_expect((expr), 1)
|
||||
#define unlikely(expr) __builtin_expect((expr), 0)
|
||||
@@ -859,8 +860,8 @@ static inline const char *parse_ipv4(struct packet *handler, const char *data, u
|
||||
return data;
|
||||
}
|
||||
struct ip *hdr = (struct ip *)data;
|
||||
uint8_t next_proto = hdr->ip_p;
|
||||
uint16_t hdr_len = (hdr->ip_hl & 0xf) * 4u;
|
||||
uint8_t next_proto = ipv4_get_proto(hdr);
|
||||
uint16_t hdr_len = ipv4_hdr_get_hdr_len(hdr);
|
||||
SET_LAYER(handler, layer, LAYER_TYPE_IPV4, hdr_len, data, len);
|
||||
|
||||
// ip fragmented
|
||||
|
||||
Reference in New Issue
Block a user