]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gtp: use icmp_ndo_send helper
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 11 Feb 2020 19:47:06 +0000 (20:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 08:39:58 +0000 (09:39 +0100)
commit e0fce6f945a26d4e953a147fe7ca11410322c9fe upstream.

Because gtp is calling icmp from network device context, it should use
the ndo helper so that the rate limiting applies correctly.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/gtp.c

index bb9cd1262cc99d03855f7b6ac570e16c08bf5d2a..c31b15a5e0dd3462cf8bfd44b85c19ce0b9348be 100644 (file)
@@ -550,8 +550,8 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev,
            mtu < ntohs(iph->tot_len)) {
                netdev_dbg(dev, "packet too big, fragmentation needed\n");
                memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
-               icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
-                         htonl(mtu));
+               icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
+                             htonl(mtu));
                goto err_rt;
        }