icmp: introduce helper for nat'd source address in network device context
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 11 Feb 2020 19:47:05 +0000 (20:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Mar 2021 16:44:45 +0000 (17:44 +0100)
commite9b06769ba0cff2cd1087c1b10c10d5280387bb1
tree66d4df198fd76edab301b69558d33b3c4c0d9b00
parent91509e84949fc97e7424521c32a9e227746e0b85
icmp: introduce helper for nat'd source address in network device context

commit 0b41713b606694257b90d61ba7e2712d8457648b upstream.

This introduces a helper function to be called only by network drivers
that wraps calls to icmp[v6]_send in a conntrack transformation, in case
NAT has been used. We don't want to pollute the non-driver path, though,
so we introduce this as a helper to be called by places that actually
make use of this, as suggested by Florian.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/icmpv6.h
include/net/icmp.h
net/ipv4/icmp.c
net/ipv6/ip6_icmp.c