2.6.13-git3: build failure: sysctl_optmem_max

2 messages, 2 authors, 2005-09-03 · open the first message on its own page

2.6.13-git3: build failure: sysctl_optmem_max

From: Russell King <hidden>
Date: 2005-09-03 10:28:03

While trying to build a kernel with CONFIG_SYSCTL disabled, the following
error occurs:

  CC      net/ipv4/ip_sockglue.o
net/ipv4/ip_sockglue.c: In function `ip_setsockopt':
net/ipv4/ip_sockglue.c:622: error: `sysctl_optmem_max' undeclared (first use in
net/ipv4/ip_sockglue.c:622: error: (Each undeclared identifier is reported only
net/ipv4/ip_sockglue.c:622: error: for each function it appears in.)

It seems that sysctl_optmem_max is only available if CONFIG_SYSCTL is set.
However, ip_setsockopt makes unconditional usage of this variable.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

Re: 2.6.13-git3: build failure: sysctl_optmem_max

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2005-09-03 12:48:27

In article [off-list ref] (at Sat, 3 Sep 2005 11:27:56 +0100), Russell King [off-list ref] says:
While trying to build a kernel with CONFIG_SYSCTL disabled, the following
error occurs:

  CC      net/ipv4/ip_sockglue.o
net/ipv4/ip_sockglue.c: In function `ip_setsockopt':
net/ipv4/ip_sockglue.c:622: error: `sysctl_optmem_max' undeclared (first use in
net/ipv4/ip_sockglue.c:622: error: (Each undeclared identifier is reported only
net/ipv4/ip_sockglue.c:622: error: for each function it appears in.)

It seems that sysctl_optmem_max is only available if CONFIG_SYSCTL is set.
However, ip_setsockopt makes unconditional usage of this variable.
This should fix the issue.

Signed-off-by: YOSHIFUJI Hideaki <redacted>
diff --git a/include/net/sock.h b/include/net/sock.h
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1374,8 +1374,8 @@ extern void sk_init(void);
 
 #ifdef CONFIG_SYSCTL
 extern struct ctl_table core_table[];
-extern int sysctl_optmem_max;
 #endif
+extern int sysctl_optmem_max;
 
 extern __u32 sysctl_wmem_default;
 extern __u32 sysctl_rmem_default;
diff --git a/net/core/sock.c b/net/core/sock.c
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1719,8 +1719,8 @@ EXPORT_SYMBOL(sock_wfree);
 EXPORT_SYMBOL(sock_wmalloc);
 EXPORT_SYMBOL(sock_i_uid);
 EXPORT_SYMBOL(sock_i_ino);
-#ifdef CONFIG_SYSCTL
 EXPORT_SYMBOL(sysctl_optmem_max);
+#ifdef CONFIG_SYSCTL
 EXPORT_SYMBOL(sysctl_rmem_max);
 EXPORT_SYMBOL(sysctl_wmem_max);
 #endif
-- 
YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help