openvswitch: use skb_ip_totlen in conntrack
authorXin Long <lucien.xin@gmail.com>
Sat, 28 Jan 2023 15:58:32 +0000 (10:58 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 2 Feb 2023 04:54:27 +0000 (20:54 -0800)
IPv4 GSO packets may get processed in ovs_skb_network_trim(),
and we need to use skb_ip_totlen() to get iph totlen.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/openvswitch/conntrack.c

index c8b1376..2172930 100644 (file)
@@ -1103,7 +1103,7 @@ static int ovs_skb_network_trim(struct sk_buff *skb)
 
        switch (skb->protocol) {
        case htons(ETH_P_IP):
-               len = ntohs(ip_hdr(skb)->tot_len);
+               len = skb_ip_totlen(skb);
                break;
        case htons(ETH_P_IPV6):
                len = sizeof(struct ipv6hdr)