Message ID | 20250212132418.1524422-2-edumazet@google.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 54568a84c95bdea20227cf48d41f198d083e78dd |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: add EXPORT_IPV6_MOD() | expand |
From: Eric Dumazet <edumazet@google.com> Date: Wed, 12 Feb 2025 13:24:15 +0000 > 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>
On 2/12/2025 2:24 PM, Eric Dumazet wrote: > 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> > --- > include/net/ip.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/net/ip.h b/include/net/ip.h > index 9f5e33e371fcdd8ea88c54584b8d4b6c50e7d0c9..1e40c5ac53a74e1c20157709e49edf2271e44fe3 100644 > --- a/include/net/ip.h > +++ b/include/net/ip.h > @@ -666,6 +666,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 Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
diff --git a/include/net/ip.h b/include/net/ip.h index 9f5e33e371fcdd8ea88c54584b8d4b6c50e7d0c9..1e40c5ac53a74e1c20157709e49edf2271e44fe3 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -666,6 +666,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
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> --- include/net/ip.h | 8 ++++++++ 1 file changed, 8 insertions(+)