gtp: use icmp_ndo_send helper
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 11 Feb 2020 19:47:06 +0000 (20:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2020 22:19:00 +0000 (14:19 -0800)
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>
drivers/net/gtp.c

index af07ea760b359ba99a550e733f8327a6144b5957..672cd2caf2fbec6f1020f4dc30adfb8d96a8f917 100644 (file)
@@ -546,8 +546,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;
        }