diff mbox series

[ovs-dev,branch-2.6,2/2] conntrack: Fix L4 csum for V6 extension hdr pkts.

Message ID 1551135890-121740-2-git-send-email-dlu998@gmail.com
State Accepted
Commit cf9bb767128c00d20795bf5ef1148e618fcaf104
Headers show
Series [ovs-dev,branch-2.6,1/2] packets: Change return type of 'packet_csum_upperlayer6()'. | expand

Commit Message

Darrell Ball Feb. 25, 2019, 11:04 p.m. UTC
It is a day one issue that got copied to subsequent code.

Fixes: a489b16854b5 ("conntrack: New userspace connection tracker.")
Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.")
CC: Daniele Di Proietto <diproiettod@ovn.org>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
---
 lib/conntrack.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index 1917fd8..2f2e6a3 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -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