History

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.

Jason A. Donenfeld committed 6 years ago

Commit 0b417131 parent 07134cf4 files · +79 −0Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/icmpv6.h+6−0
@@ -31,6 +31,12 @@ static inline void icmpv6_send(struct sk_buff *skb, · 30 unmodified lines
3131 }
3232 #endif
3333
34+#if IS_ENABLED(CONFIG_NF_NAT)
35+void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info);
36+#else
37+#define icmpv6_ndo_send icmpv6_send
38+#endif
39+
3440 extern int icmpv6_init(void);
3541 extern int icmpv6_err_convert(u8 type, u8 code,
3642 int *err);