[2188] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: net module patch

daemon@ATHENA.MIT.EDU (Bjorn Ekwall)
Thu Mar 21 04:12:49 1996

From: bj0rn@blox.se (Bjorn Ekwall)
To: tdyas@eden.rutgers.edu (Tom Dyas), alan@lxorguk.ukuu.org.uk (Alan Cox)
Date: 	Thu, 21 Mar 1996 09:56:23 +0100 (MET)
Cc: linux-net@vger.rutgers.edu
In-Reply-To: <CMM-RU.1.5.827376244.tdyas@er6.rutgers.edu> from "Tom Dyas" at Mar 20, 96 09:44:04 pm

I have some small suggestions for things to add to the net module patch.
It mainly concerns the symbol versioning (via CONFIG_MODVERSIONS).

I have moved "#include <linux/module.h>" to the top of some files,
so that the "magic" for versioning can work as intended,

I have also modified some Makefiles to use OX_OBJS/LX_OBJS instead
of O_OBJS/L_OBJS so that these objects will be handled by genksyms
during "make dep". (The extra "X" indicates an "eXporting" object.)

I _still_ think that "struct sock" in "linux/include/net/sock.h"
should contain all the possible members in the union, so that
one won't have to recompile _all_ versioned net modules just because
the configuration was changed...

Cheers,

Bjorn  <bj0rn@blox.se>  <http://www.pi.se/blox/>


The following patch should be applied _after_ the "net module" patch:

--- linux/net/802/psnap.c.patched	Thu Mar 21 09:21:49 1996
+++ linux/net/802/psnap.c	Thu Mar 21 09:22:25 1996
@@ -10,6 +10,7 @@
  *		2 of the License, or (at your option) any later version.
  */
  
+#include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/datalink.h>
@@ -17,7 +18,6 @@
 #include <net/psnap.h>
 #include <linux/mm.h>
 #include <linux/in.h>
-#include <linux/module.h>
 
 static struct datalink_proto *snap_list = NULL;
 static struct datalink_proto *snap_dl = NULL;		/* 802.2 DL for SNAP */
--- linux/net/802/Makefile.patched	Thu Mar 21 09:22:34 1996
+++ linux/net/802/Makefile	Thu Mar 21 09:26:13 1996
@@ -15,12 +15,12 @@
 endif
 
 ifdef CONFIG_IPX
-O_OBJS += p8022.o psnap.o
+OX_OBJS += p8022.o psnap.o
 endif
 
 ifdef CONFIG_ATALK
 ifndef CONFIG_IPX
-O_OBJS += p8022.o psnap.o
+OX_OBJS += p8022.o psnap.o
 endif
 endif
 
--- linux/net/802/p8022.c.patched	Thu Mar 21 09:24:28 1996
+++ linux/net/802/p8022.c	Thu Mar 21 09:24:39 1996
@@ -1,9 +1,9 @@
+#include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/datalink.h>
 #include <linux/mm.h>
 #include <linux/in.h>
-#include <linux/module.h>
 #include <net/p8022.h>
 
 static struct datalink_proto *p8022_list = NULL;
--- linux/net/appletalk/ddp.c.patched	Thu Mar 21 09:20:30 1996
+++ linux/net/appletalk/ddp.c	Thu Mar 21 09:21:01 1996
@@ -31,10 +31,11 @@
  *		ASYNC I/O
  */
  
+#include <linux/config.h>
+#include <linux/module.h>
 #include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -62,7 +63,6 @@
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/firewall.h>
-#include <linux/module.h>
 
 
 #undef APPLETALK_DEBUG
--- linux/net/Makefile.patched	Thu Mar 21 09:26:51 1996
+++ linux/net/Makefile	Thu Mar 21 09:29:55 1996
@@ -41,7 +41,11 @@
 endif
 
 L_TARGET     := network.a
-L_OBJS	     := netsyms.o socket.o protocols.o $(join $(SUB_DIRS),$(SUB_DIRS:%=/%.o))
+L_OBJS	     := socket.o protocols.o $(join $(SUB_DIRS),$(SUB_DIRS:%=/%.o))
+ifeq ($(CONFIG_MODULES),y)
+LX_OBJS = netsyms.o
+endif
+
 M_OBJS	     :=
 
 ifeq ($(CONFIG_NETLINK),y)
--- linux/net/socket.c.patched	Thu Mar 21 09:34:47 1996
+++ linux/net/socket.c	Thu Mar 21 09:35:36 1996
@@ -72,7 +72,9 @@
 #include <asm/system.h>
 #include <asm/segment.h>
 
+#ifdef MODULE
 extern void export_net_symbols(void);
+#endif
 
 static int sock_lseek(struct inode *inode, struct file *file, off_t offset,
 		      int whence);
@@ -1411,7 +1413,9 @@
 	 *	Export networking symbols to the world.
 	 */
 
+#ifdef MODULE
 	export_net_symbols();
+#endif
 }
 
 int socket_get_info(char *buffer, char **start, off_t offset, int length)


home help back first fref pref prev next nref lref last post