[2204] 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 (Tom Dyas)
Thu Mar 21 20:17:45 1996

Date: 	Thu, 21 Mar 96 15:41:48 EST
From: Tom Dyas <tdyas@eden.rutgers.edu>
To: bj0rn@blox.se (Bjorn Ekwall)
Cc: alan@lxorguk.ukuu.org.uk (Alan Cox), linux-net@vger.rutgers.edu
In-Reply-To: Your message of Thu, 21 Mar 1996 09:56:23 +0100 (MET)

> 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.)

Oops ... forgot that symbol table object files need to be listed in
OX_OBJS and/or LX_OBJS. Is there any documentation on this? It would
be nice to see a tome on "everything you wanted to know about modules
and were afraid to ask" sitting in the Documentation subdir of the
kernel source. That way, lusers like me can do the Right Thing [TM]
the first time around. :)

> 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...

You had favored solution #1 (throw everything in), while Alan had
favored solution #2 (condition compilation). Technically, versioned
modules would prevent a user from inserting a protocol module into a
kernel not compiled for that protocol. However, if and/or when, the
tcp/ip stuff gets moved into protinfo, the size of the structure will
never change since the tcp stuff will always be the largest item in
the union.

My own opinion is that currently #2 makes sense to save space, but #1
can be used later when the entire point of saving a little space is
moot. Makes no difference to me which one is used. We should hash this
point out, however.

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

For the record, the "net module" patch can be retrieved from:

ftp://vger.rutgers.edu/pub/users/tdyas/net-module-1.3.76.patch.gz

> --- 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)

Shouldn't the macro in the #ifdef be CONFIG_MODULES instead of MODULE?
It would be extremely hard to load IPX or AppleTalk as a module when
socket.c will never be compiled with MODULE defined. :)

Tom


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