diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-02-11 22:47:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-14 01:19:00 +0300 |
commit | a12d7f3cbdc72c7625881c8dc2660fc2c979fdf2 (patch) | |
tree | f48df8094b2070df02c3c999916697e9226cfb07 /drivers/net/wireguard | |
parent | 67c9a7e1e3ac491b5df018803639addc36f154ba (diff) | |
download | linux-a12d7f3cbdc72c7625881c8dc2660fc2c979fdf2.tar.xz |
wireguard: device: use icmp_ndo_send helper
Because wireguard is calling icmp from network device context, it should
use the ndo helper so that the rate limiting applies correctly. This
commit adds a small test to the wireguard test suite to ensure that the
new functions continue doing the right thing in the context of
wireguard. It does this by setting up a condition that will definately
evoke an icmp error message from the driver, but along a nat'd path.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireguard')
-rw-r--r-- | drivers/net/wireguard/device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c index 16b19824b9ad..43db442b1373 100644 --- a/drivers/net/wireguard/device.c +++ b/drivers/net/wireguard/device.c @@ -203,9 +203,9 @@ err_peer: err: ++dev->stats.tx_errors; if (skb->protocol == htons(ETH_P_IP)) - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); else if (skb->protocol == htons(ETH_P_IPV6)) - icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0); + icmpv6_ndo_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0); kfree_skb(skb); return ret; } |