decode: don't clear computed csums twice

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

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

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

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

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

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

Loading…
Cancel
Save