netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Willem de Bruijn <willemb@google.com>,
	 Simon Horman <horms@kernel.org>,
	eric.dumazet@gmail.com,  Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 1/4] net: introduce EXPORT_IPV6_MOD() and EXPORT_IPV6_MOD_GPL()
Date: Mon, 10 Feb 2025 08:28:02 +0000	[thread overview]
Message-ID: <20250210082805.465241-2-edumazet@google.com> (raw)
In-Reply-To: <20250210082805.465241-1-edumazet@google.com>

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
-- 
2.48.1.502.g6dc24dfdaf-goog


  reply	other threads:[~2025-02-10  8:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10  8:28 [PATCH net-next 0/4] net: add EXPORT_IPV6_MOD() Eric Dumazet
2025-02-10  8:28 ` Eric Dumazet [this message]
2025-02-10  8:28 ` [PATCH net-next 2/4] inetpeer: use EXPORT_IPV6_MOD[_GPL]() Eric Dumazet
2025-02-10  8:28 ` [PATCH net-next 3/4] tcp: " Eric Dumazet
2025-02-10  8:41   ` Mateusz Polchlopek
2025-02-10  9:08     ` Eric Dumazet
2025-02-10  9:23       ` Mateusz Polchlopek
2025-02-10  9:30   ` Sabrina Dubroca
2025-02-10  9:44     ` Eric Dumazet
2025-02-10  9:56       ` Eric Dumazet
2025-02-10 11:35         ` Sabrina Dubroca
2025-02-10 12:26           ` Eric Dumazet
2025-02-10 12:21   ` kernel test robot
2025-02-10  8:28 ` [PATCH net-next 4/4] udp: " Eric Dumazet
2025-02-11  2:56   ` Willem de Bruijn
2025-02-11  8:08     ` Eric Dumazet
2025-02-10  9:25 ` [PATCH net-next 0/4] net: add EXPORT_IPV6_MOD() Mateusz Polchlopek
2025-02-10 18:33 ` Willem de Bruijn
2025-02-10 18:46   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250210082805.465241-2-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).