Re: 2.4.14 net errors

David S. Miller (davem@redhat.com)
Tue, 06 Nov 2001 21:55:41 -0800 (PST)


From: Keith Owens <kaos@ocs.com.au>
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.~1~ Mon Nov 5 09:57:13 2001
+++ ./net/core/sock.c Tue Nov 6 21:33:48 2001
@@ -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.~1~ Sun Oct 21 02:47:54 2001
+++ ./net/core/skbuff.c Tue Nov 6 21:33:24 2001
@@ -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.~1~ Sun Oct 21 02:47:54 2001
+++ ./net/core/datagram.c Tue Nov 6 21:40:33 2001
@@ -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.~1~ Sun Oct 21 02:47:54 2001
+++ ./net/core/scm.c Tue Nov 6 21:42:23 2001
@@ -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.~1~ Wed Oct 31 10:56:41 2001
+++ ./net/socket.c Tue Nov 6 21:44:29 2001
@@ -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>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/