Skip to content

Commit

Permalink
conntrack: Fix L4 csum for V6 extension hdr pkts.
Browse files Browse the repository at this point in the history
It is a day one issue that got copied to subsequent code.

Fixes: a489b16 ("conntrack: New userspace connection tracker.")
CC: Daniele Di Proietto <diproiettod@ovn.org>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
darball1 authored and blp committed Feb 25, 2019
1 parent 87243b0 commit 07a17f6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/conntrack.c
Expand Up @@ -603,19 +603,14 @@ static inline bool
checksum_valid(const struct conn_key *key, const void *data, size_t size,
const void *l3)
{
uint32_t csum = 0;

if (key->dl_type == htons(ETH_TYPE_IP)) {
csum = packet_csum_pseudoheader(l3);
uint32_t csum = packet_csum_pseudoheader(l3);
return csum_finish(csum_continue(csum, data, size)) == 0;
} else if (key->dl_type == htons(ETH_TYPE_IPV6)) {
csum = packet_csum_pseudoheader6(l3);
return packet_csum_upperlayer6(l3, data, key->nw_proto, size) == 0;
} else {
return false;
}

csum = csum_continue(csum, data, size);

return csum_finish(csum) == 0;
}

static inline bool
Expand Down

0 comments on commit 07a17f6

Please sign in to comment.