summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-02-12 13:24:15 +0000
committerJakub Kicinski <kuba@kernel.org>2025-02-14 13:09:38 -0800
commit54568a84c95bdea20227cf48d41f198d083e78dd (patch)
tree0c1b143886d0b277f1562769d23132fdd51c08b9
parent7a7e0197133d18cfd9931e7d3a842d0f5730223f (diff)
net: introduce EXPORT_IPV6_MOD() and EXPORT_IPV6_MOD_GPL()
We have many EXPORT_SYMBOL(x) in networking tree because IPv6 can be built as a module. CONFIG_IPV6=y is becoming the norm. Define a EXPORT_IPV6_MOD(x) which only exports x for modular IPv6. Same principle applies to EXPORT_IPV6_MOD_GPL() Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com> Link: https://patch.msgid.link/20250212132418.1524422-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--include/net/ip.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index ba7b43447775..305eccdf4ff7 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -673,6 +673,14 @@ static inline void ip_ipgre_mc_map(__be32 naddr, const unsigned char *broadcast,
memcpy(buf, &naddr, sizeof(naddr));
}
+#if IS_MODULE(CONFIG_IPV6)
+#define EXPORT_IPV6_MOD(X) EXPORT_SYMBOL(X)
+#define EXPORT_IPV6_MOD_GPL(X) EXPORT_SYMBOL_GPL(X)
+#else
+#define EXPORT_IPV6_MOD(X)
+#define EXPORT_IPV6_MOD_GPL(X)
+#endif
+
#if IS_ENABLED(CONFIG_IPV6)
#include <linux/ipv6.h>
#endif