summaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp_offload.c
diff options
context:
space:
mode:
authorAndrew Melnychenko <andrew@daynix.com>2022-12-07 12:35:53 +0100
committerDavid S. Miller <davem@davemloft.net>2022-12-12 10:29:56 +0100
commit1fd54773c26787b9aea80e2f62c7d0780ea444d0 (patch)
tree46efb46e4553a8d47ed613d277a40eb5cc8b83ce /net/ipv4/udp_offload.c
parentMerge tag 'ipsec-next-2022-12-09' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
downloadlinux-1fd54773c26787b9aea80e2f62c7d0780ea444d0.tar.xz
linux-1fd54773c26787b9aea80e2f62c7d0780ea444d0.zip
udp: allow header check for dodgy GSO_UDP_L4 packets.
Allow UDP_L4 for robust packets. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Andrew Melnychenko <andrew@daynix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp_offload.c')
-rw-r--r--net/ipv4/udp_offload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index aedde65e2268..1f01e15ca24f 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -387,7 +387,8 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
if (!pskb_may_pull(skb, sizeof(struct udphdr)))
goto out;
- if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
+ if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 &&
+ !skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST))
return __udp_gso_segment(skb, features, false);
mss = skb_shinfo(skb)->gso_size;