udp: exclude gso from xfrm paths
authorWillem de Bruijn <willemb@google.com>
Tue, 22 May 2018 15:34:39 +0000 (11:34 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 May 2018 18:48:44 +0000 (14:48 -0400)
UDP GSO delays final datagram construction to the GSO layer. This
conflicts with protocol transformations.

Fixes: bec1f6f69736 ("udp: generate gso with UDP_SEGMENT")
CC: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c
net/ipv6/udp.c

index ff4d4ba..d71f1f3 100644 (file)
@@ -788,7 +788,8 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
                        return -EINVAL;
                if (sk->sk_no_check_tx)
                        return -EINVAL;
-               if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite)
+               if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
+                   dst_xfrm(skb_dst(skb)))
                        return -EIO;
 
                skb_shinfo(skb)->gso_size = cork->gso_size;
index 2839c1b..426c9d2 100644 (file)
@@ -1053,7 +1053,8 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
                        return -EINVAL;
                if (udp_sk(sk)->no_check6_tx)
                        return -EINVAL;
-               if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite)
+               if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
+                   dst_xfrm(skb_dst(skb)))
                        return -EIO;
 
                skb_shinfo(skb)->gso_size = cork->gso_size;