Skip to content

Commit 94a4b1f

Browse files
committed
ipv6: move the disable_ipv6_mod knob to core code
From: Jakub Kicinski <kuba@kernel.org> Make sure disable_ipv6_mod itself is not part of the IPv6 module, in case core code wants to refer to it. We will remove support for IPv6=m soon, this change helps make fixes we commit before that less messy. Link: https://patch.msgid.link/20260307-net-nd_tbl_fixes-v4-1-e2677e85628c@suse.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 908c344 commit 94a4b1f

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

include/linux/ipv6.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ struct tcp6_timewait_sock {
333333
};
334334

335335
#if IS_ENABLED(CONFIG_IPV6)
336-
bool ipv6_mod_enabled(void);
336+
extern int disable_ipv6_mod;
337+
338+
static inline bool ipv6_mod_enabled(void)
339+
{
340+
return disable_ipv6_mod == 0;
341+
}
337342

338343
static inline struct ipv6_pinfo *inet6_sk(const struct sock *__sk)
339344
{

net/ipv4/af_inet.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@
124124

125125
#include <trace/events/sock.h>
126126

127+
/* Keep the definition of IPv6 disable here for now, to avoid annoying linker
128+
* issues in case IPv6=m
129+
*/
130+
int disable_ipv6_mod;
131+
EXPORT_SYMBOL(disable_ipv6_mod);
132+
127133
/* The inetsw table contains everything that inet_create needs to
128134
* build a new socket.
129135
*/

net/ipv6/af_inet6.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ struct ipv6_params ipv6_defaults = {
8686
.autoconf = 1,
8787
};
8888

89-
static int disable_ipv6_mod;
90-
9189
module_param_named(disable, disable_ipv6_mod, int, 0444);
9290
MODULE_PARM_DESC(disable, "Disable IPv6 module such that it is non-functional");
9391

@@ -97,12 +95,6 @@ MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces");
9795
module_param_named(autoconf, ipv6_defaults.autoconf, int, 0444);
9896
MODULE_PARM_DESC(autoconf, "Enable IPv6 address autoconfiguration on all interfaces");
9997

100-
bool ipv6_mod_enabled(void)
101-
{
102-
return disable_ipv6_mod == 0;
103-
}
104-
EXPORT_SYMBOL_GPL(ipv6_mod_enabled);
105-
10698
static struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
10799
{
108100
const int offset = sk->sk_prot->ipv6_pinfo_offset;

0 commit comments

Comments
 (0)