projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
adc8df1
)
gtp: fix fragmentation needed check with gso
author
Pablo Neira Ayuso
<pablo@netfilter.org>
Sun, 22 Oct 2023 20:25:18 +0000
(22:25 +0200)
committer
Paolo Abeni
<pabeni@redhat.com>
Tue, 24 Oct 2023 10:02:02 +0000
(12:02 +0200)
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>
drivers/net/gtp.c
patch
|
blob
|
history
diff --git
a/drivers/net/gtp.c
b/drivers/net/gtp.c
index
144ec62
..
b22596b
100644
(file)
--- a/
drivers/net/gtp.c
+++ b/
drivers/net/gtp.c
@@
-872,8
+872,9
@@
static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev,
skb_dst_update_pmtu_no_confirm(skb, mtu);
- if (!skb_is_gso(skb) && (iph->frag_off & htons(IP_DF)) &&
- mtu < ntohs(iph->tot_len)) {
+ if (iph->frag_off & htons(IP_DF) &&
+ ((!skb_is_gso(skb) && skb->len > mtu) ||
+ (skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu)))) {
netdev_dbg(dev, "packet too big, fragmentation needed\n");
icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
htonl(mtu));