decode: don't clear computed csums twice

Already done in a generic way by PACKET_RESET_CHECKSUMS.
pull/10783/head
Victor Julien 2 years ago committed by Victor Julien
parent 40afbf5b09
commit 561b81dd9e

@ -221,8 +221,8 @@ typedef struct ICMPV4Timestamp_ {
uint32_t tx_ts;
} __attribute__((__packed__)) ICMPV4Timestamp;
#define CLEAR_ICMPV4_PACKET(p) do { \
(p)->level4_comp_csum = -1; \
#define CLEAR_ICMPV4_PACKET(p) \
do { \
PACKET_CLEAR_L4VARS((p)); \
(p)->icmpv4h = NULL; \
} while (0)

@ -182,9 +182,8 @@ typedef struct ICMPV6Vars_ {
} ICMPV6Vars;
#define CLEAR_ICMPV6_PACKET(p) do { \
(p)->level4_comp_csum = -1; \
#define CLEAR_ICMPV6_PACKET(p) \
do { \
PACKET_CLEAR_L4VARS((p)); \
(p)->icmpv6h = NULL; \
} while (0)

@ -148,9 +148,9 @@ typedef struct IPV4Hdr_
#define IPV4_GET_IPPROTO(p) \
IPV4_GET_RAW_IPPROTO((p)->ip4h)
#define CLEAR_IPV4_PACKET(p) do { \
#define CLEAR_IPV4_PACKET(p) \
do { \
(p)->ip4h = NULL; \
(p)->level3_comp_csum = -1; \
memset(&p->ip4vars, 0x00, sizeof(p->ip4vars)); \
} while (0)

@ -168,8 +168,8 @@ typedef struct TCPVars_
TCPOpt tfo; /* tcp fast open */
} TCPVars;
#define CLEAR_TCP_PACKET(p) { \
(p)->level4_comp_csum = -1; \
#define CLEAR_TCP_PACKET(p) \
{ \
PACKET_CLEAR_L4VARS((p)); \
(p)->tcph = NULL; \
}

@ -46,8 +46,8 @@ typedef struct UDPHdr_
uint16_t uh_sum; /* checksum */
} UDPHdr;
#define CLEAR_UDP_PACKET(p) do { \
(p)->level4_comp_csum = -1; \
#define CLEAR_UDP_PACKET(p) \
do { \
(p)->udph = NULL; \
} while (0)

Loading…
Cancel
Save