mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-28 21:45:01 +08:00
gtp: fix fragmentation needed check with gso
[ Upstream commit4530e5b8e2
] Call skb_gso_validate_network_len() to check if packet is over PMTU. Fixes:459aa660eb
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c0dad0c092
commit
d5c175f4ce
@ -543,8 +543,9 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev,
|
||||
|
||||
rt->dst.ops->update_pmtu(&rt->dst, NULL, skb, mtu, false);
|
||||
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user