Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gtp: fix fragmentation needed check with gso

Call skb_gso_validate_network_len() to check if packet is over PMTU.

Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Pablo Neira Ayuso and committed by
Paolo Abeni
4530e5b8 adc8df12

+3 -2
+3 -2
drivers/net/gtp.c
··· 872 872 873 873 skb_dst_update_pmtu_no_confirm(skb, mtu); 874 874 875 - if (!skb_is_gso(skb) && (iph->frag_off & htons(IP_DF)) && 876 - mtu < ntohs(iph->tot_len)) { 875 + if (iph->frag_off & htons(IP_DF) && 876 + ((!skb_is_gso(skb) && skb->len > mtu) || 877 + (skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu)))) { 877 878 netdev_dbg(dev, "packet too big, fragmentation needed\n"); 878 879 icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 879 880 htonl(mtu));