2003-01-07 06:32:40

by Miles Bader

[permalink] [raw]
Subject: [PATCH] Fix socket.c compilation failure when CONFIG_NET=n

[I send this to Linus earlier and he ignored it; maybe you're the right
person...]

In net/socket.c, <linux/wireless.h> is included twice, once conditionally
(on CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO) and once unconditionally.
However, including <linux/wireless.h> defines WIRELESS_EXT, and this causes an
#ifdef in `sock_ioctl' to reference `dev_ioctl', which isn't defined when
CONFIG_NET=n, and so results in an unresolved symbol reference in that case.

The following patch fixes this by removing the unconditional include, and only
keeping the conditional one.

Thanks,

-Miles

diff -ruN -X../cludes linux-2.5.54-moo.orig/net/socket.c linux-2.5.54-moo/net/socket.c
--- linux-2.5.54-moo.orig/net/socket.c 2002-11-25 10:30:11.000000000 +0900
+++ linux-2.5.54-moo/net/socket.c 2003-01-06 13:27:17.000000000 +0900
@@ -75,7 +75,6 @@
#include <linux/cache.h>
#include <linux/module.h>
#include <linux/highmem.h>
-#include <linux/wireless.h>
#include <linux/divert.h>
#include <linux/mount.h>


2003-01-09 17:57:49

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: [PATCH] Fix socket.c compilation failure when CONFIG_NET=n

On Tue, Jan 07, 2003 at 03:41:07PM +0900, Miles Bader wrote:
> [I send this to Linus earlier and he ignored it; maybe you're the right
> person...]
>
> In net/socket.c, <linux/wireless.h> is included twice, once conditionally
> (on CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO) and once unconditionally.
> However, including <linux/wireless.h> defines WIRELESS_EXT, and this causes an
> #ifdef in `sock_ioctl' to reference `dev_ioctl', which isn't defined when
> CONFIG_NET=n, and so results in an unresolved symbol reference in that case.
>
> The following patch fixes this by removing the unconditional include, and only
> keeping the conditional one.
>
> Thanks,
>
> -Miles
>
> diff -ruN -X../cludes linux-2.5.54-moo.orig/net/socket.c linux-2.5.54-moo/net/socket.c
> --- linux-2.5.54-moo.orig/net/socket.c 2002-11-25 10:30:11.000000000 +0900
> +++ linux-2.5.54-moo/net/socket.c 2003-01-06 13:27:17.000000000 +0900
> @@ -75,7 +75,6 @@
> #include <linux/cache.h>
> #include <linux/module.h>
> #include <linux/highmem.h>
> -#include <linux/wireless.h>
> #include <linux/divert.h>
> #include <linux/mount.h>

This was included in 2.5.55, so I guess Linus didn't ignored you.
Regards,

Jean