summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-02-11 22:47:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-04 11:39:58 +0300
commit3efde1864ab5552d8c9411e0112f5508b4c7ec47 (patch)
treed7a8ce4f4a3bf541ade11e4916d9f4a10285c304 /include/net
parentfc204c6b398378a70d79cbac24cd16cce412a0c7 (diff)
downloadlinux-3efde1864ab5552d8c9411e0112f5508b4c7ec47.tar.xz
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>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/icmp.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 8665bf24e3b7..9c344e2655d2 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -47,6 +47,12 @@ static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32
__icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
}
+#if IS_ENABLED(CONFIG_NF_NAT)
+void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info);
+#else
+#define icmp_ndo_send icmp_send
+#endif
+
int icmp_rcv(struct sk_buff *skb);
void icmp_err(struct sk_buff *skb, u32 info);
int icmp_init(void);