Treat incomplete checksum.

Checksum of local traffic is often offloaded to the network device.
This causes some problems on parsing of this traffic. This patch
introduces a PKT_INCOMPLETE_CHECKSUM flag which can be used to
indicate that the checksum is not computed/correct for good reason.
remotes/origin/master-1.2.x
Eric Leblond 13 years ago committed by Victor Julien
parent 9324ed7b90
commit 81bc6f5518

@ -879,6 +879,8 @@ void AddressDebugPrint(Address *);
#define PKT_TUNNEL 0x1000
#define PKT_TUNNEL_VERDICTED 0x2000
#define PKT_IGNORE_CHECKSUM 0x4000 /**< Packet checksum is not computed (TX packet for example) */
/** \brief return 1 if the packet is a pseudo packet */
#define PKT_IS_PSEUDOPKT(p) ((p)->flags & PKT_PSEUDO_STREAM_END)

@ -3828,6 +3828,9 @@ static inline int StreamTcpValidateChecksum(Packet *p)
{
int ret = 1;
if (p->flags & PKT_IGNORE_CHECKSUM)
return ret;
if (p->tcpvars.comp_csum == -1) {
if (PKT_IS_IPV4(p)) {
p->tcpvars.comp_csum = TCPCalculateChecksum((uint16_t *)&(p->ip4h->ip_src),

Loading…
Cancel
Save