Skip to contentSkip to conversation

2.4.14 net errors

DISCUSSION Keith Owens 2 participants 2 messages Nov 7, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Compile a minimal 2.4.14 kernel, everything set to N.

include/net/tcp_ecn.h: In function `TCP_ECN_send':
In file included from include/net/tcp.h:1036,
from net/core/sock.c:122:
include/net/tcp_ecn.h:54: union has no member named af_inet' include/net/tcp_ecn.h:61: union has no member named af_inet'

# CONFIG_NET is not set
# CONFIG_PCI is not set
# CONFIG_EISA is not set
# CONFIG_MCA is not set
# CONFIG_HOTPLUG is not set
# CONFIG_PCMCIA is not set
# CONFIG_SYSVIPC is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
# CONFIG_BINFMT_AOUT is not set
# CONFIG_BINFMT_ELF is not set
# CONFIG_BINFMT_MISC is not set
# CONFIG_PM is not set
# CONFIG_APM is not set

kbuild 2.5 has a note in net/core/Makefile.in

# FIXME: this always selects these objects, even when CONFIG_NET is # 'n'. Probably wrong but 2.4.0-test13-pre4 did the same. KAO

select(sock.o skbuff.o iovec.o datagram.o scm.o)

Why do we compile these objects even when CONFIG_NET=n?

#1 lore raw

From: Keith Owens <[email protected]>
Date: Wed, 07 Nov 2001 15:08:38 +1100

Compile a minimal 2.4.14 kernel, everything set to N.

include/net/tcp_ecn.h: In function `TCP_ECN_send':

This problem has actually been around for a long time. Be always suspicious of generic networking support code which includes things like "tcp.h" and "udp.h" :-)

Fix at the end of this email.

# FIXME: this always selects these objects, even when CONFIG_NET is # 'n'. Probably wrong but 2.4.0-test13-pre4 did the same. KAO

select(sock.o skbuff.o iovec.o datagram.o scm.o)

Why do we compile these objects even when CONFIG_NET=n?

Probably to get the socket system calls. That could easily be fixed by just providing stubs. There could be other references via the VFS... one I know of is sock_readv_writev().

Anyways, here is the patch:

net/core/sock.c renamed from net/core/sock.c.~1~ +0 -8
@@ -113,18 +113,10 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
-#include <linux/inet.h>
 #include <linux/netdevice.h>
-#include <net/ip.h>
 #include <net/protocol.h>
-#include <net/arp.h>
-#include <net/route.h>
-#include <net/tcp.h>
-#include <net/udp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <net/raw.h>
-#include <net/icmp.h>
 #include <linux/ipsec.h>
 
 #ifdef CONFIG_FILTER
net/core/skbuff.c renamed from net/core/skbuff.c.~1~ +2 -3
@@ -49,15 +49,14 @@
 #include <linux/string.h>
 #include <linux/skbuff.h>
 #include <linux/cache.h>
+#include <linux/rtnetlink.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
 
-#include <net/ip.h>
 #include <net/protocol.h>
 #include <net/dst.h>
-#include <net/tcp.h>
-#include <net/udp.h>
 #include <net/sock.h>
+#include <net/checksum.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
net/core/datagram.c renamed from net/core/datagram.c.~1~ +2 -5
@@ -30,21 +30,18 @@
 #include <asm/system.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
-#include <linux/in.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/inet.h>
 #include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
 #include <linux/poll.h>
 #include <linux/highmem.h>
 
-#include <net/ip.h>
 #include <net/protocol.h>
-#include <net/route.h>
-#include <net/tcp.h>
-#include <net/udp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
+#include <net/checksum.h>
 
 
 /*
net/core/scm.c renamed from net/core/scm.c.~1~ +0 -4
@@ -26,11 +26,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
-#include <linux/inet.h>
-#include <net/ip.h>
 #include <net/protocol.h>
-#include <net/tcp.h>
-#include <net/udp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
 #include <net/scm.h>
net/socket.c renamed from net/socket.c.~1~ +0 -4
@@ -79,12 +79,8 @@
 
 #include <asm/uaccess.h>
 
-#include <linux/inet.h>
-#include <net/ip.h>
 #include <net/sock.h>
-#include <net/tcp.h>
-#include <net/udp.h>
 #include <net/scm.h>
 #include <linux/netfilter.h>