summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-02-25 18:05:35 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-03 17:44:46 +0100
commit7f551b4b49d76455c4d3ab2e5c92288407fd5729 (patch)
tree6f8fd0eefcfcb1dec4d92e4557e23994c9d64753 /include/linux
parente9b06769ba0cff2cd1087c1b10c10d5280387bb1 (diff)
downloadlinux-stable-7f551b4b49d76455c4d3ab2e5c92288407fd5729.tar.gz
linux-stable-7f551b4b49d76455c4d3ab2e5c92288407fd5729.tar.bz2
linux-stable-7f551b4b49d76455c4d3ab2e5c92288407fd5729.zip
icmp: allow icmpv6_ndo_send to work with CONFIG_IPV6=n
commit a8e41f6033a0c5633d55d6e35993c9e2005d872f upstream. The icmpv6_send function has long had a static inline implementation with an empty body for CONFIG_IPV6=n, so that code calling it doesn't need to be ifdef'd. The new icmpv6_ndo_send function, which is intended for drivers as a drop-in replacement with an identical function signature, should follow the same pattern. Without this patch, drivers that used to work with CONFIG_IPV6=n now result in a linker error. Cc: Chen Zhou <chenzhou10@huawei.com> Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 0b41713b6066 ("icmp: introduce helper for nat'd source address in network device context") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/icmpv6.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 058d9d447086..971bd89eb06b 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -21,19 +21,23 @@ extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type,
unsigned int data_len);
+#if IS_ENABLED(CONFIG_NF_NAT)
+void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info);
+#else
+#define icmpv6_ndo_send icmpv6_send
+#endif
+
#else
static inline void icmpv6_send(struct sk_buff *skb,
u8 type, u8 code, __u32 info)
{
-
}
-#endif
-#if IS_ENABLED(CONFIG_NF_NAT)
-void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info);
-#else
-#define icmpv6_ndo_send icmpv6_send
+static inline void icmpv6_ndo_send(struct sk_buff *skb,
+ u8 type, u8 code, __u32 info)
+{
+}
#endif
extern int icmpv6_init(void);