path: root/include
diff options
authorJason A. Donenfeld <Jason@zx2c4.com>2020-02-11 20:47:05 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-13 14:19:00 -0800
commit0b41713b606694257b90d61ba7e2712d8457648b (patch)
tree9d2df288a3386102321124f7442d304b7f4fa28e /include
parentMerge branch 'skip_sw-skip_hw-validation' (diff)
icmp: introduce helper for nat'd source address in network device context
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>
Diffstat (limited to 'include')
2 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index ef1cbb5f454f..93338fd54af8 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -31,6 +31,12 @@ static inline void icmpv6_send(struct sk_buff *skb,
+void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info);
+#define icmpv6_ndo_send icmpv6_send
extern int icmpv6_init(void);
extern int icmpv6_err_convert(u8 type, u8 code,
int *err);
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 5d4bfdba9adf..9ac2d2672a93 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -43,6 +43,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);
+void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info);
+#define icmp_ndo_send icmp_send
int icmp_rcv(struct sk_buff *skb);
int icmp_err(struct sk_buff *skb, u32 info);
int icmp_init(void);