LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] IPv6 can't be built as module additionally
@ 2004-05-20 22:16 Jirka Kosina
  2004-05-20 22:50 ` David S. Miller
  2004-05-21 23:36 ` Valdis.Kletnieks
  0 siblings, 2 replies; 5+ messages in thread
From: Jirka Kosina @ 2004-05-20 22:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: pekkas, davem

Hi,

It is not possible to build ipv6 for already compiled and running kernel, 
recompilation of whole kernel, even if building as a module, is typically 
a must. This is because ipv6-specific functions in drivers/char/random.c 
are inside #ifdefs, and as random.c is almost always built directly into 
kernel, recompilation of whole kernel can't be avoided. The corresponding 
functions for IPv4 in random.c are not inside those ifdefs, and I think 
that IPv6 shouldn't be either. Recompiling whole kernel just because I 
want to build ipv6 module is quite annoying. The following patch removes 
those ifdefs and makes additional compilation of ipv6 module possible.

--- drivers/char/random.c.old	Mon May 10 04:32:00 2004
+++ drivers/char/random.c	Thu May 20 23:58:27 2004
@@ -2146,8 +2146,6 @@
 	/* Alternative: return sum of all words? */
 }
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-
 static __u32 twothirdsMD4Transform (__u32 const buf[4], __u32 const in[12])
 {
 	__u32	a = buf[0], b = buf[1], c = buf[2], d = buf[3];
@@ -2197,7 +2195,6 @@
 	return buf[1] + b;	/* "most hashed" word */
 	/* Alternative: return sum of all words? */
 }
-#endif
 
 #undef ROUND
 #undef F
@@ -2271,7 +2268,6 @@
 	return keyptr;
 }
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr,
 				   __u16 sport, __u16 dport)
 {
@@ -2309,7 +2305,6 @@
 }
 
 EXPORT_SYMBOL(secure_ipv6_id);
-#endif
 
 
 __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr,

-- 
JiKos.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] IPv6 can't be built as module additionally
  2004-05-20 22:16 [PATCH] IPv6 can't be built as module additionally Jirka Kosina
@ 2004-05-20 22:50 ` David S. Miller
  2004-05-20 23:30   ` Andy Isaacson
  2004-05-21 23:36 ` Valdis.Kletnieks
  1 sibling, 1 reply; 5+ messages in thread
From: David S. Miller @ 2004-05-20 22:50 UTC (permalink / raw)
  To: Jirka Kosina; +Cc: linux-kernel, pekkas

On Fri, 21 May 2004 00:16:06 +0200 (CEST)
Jirka Kosina <jikos@jikos.cz> wrote:

> This is because ipv6-specific functions in drivers/char/random.c 
> are inside #ifdefs, and as random.c is almost always built directly into 
> kernel, recompilation of whole kernel can't be avoided.

This is the smallest problem, several main kernel data structures
change size based upon whether ipv6 has been enabled in any way
or not.

So even with your patch, compiling ipv6 outside of the kernel will
still not work even though it might build.

This has been discussed to death in the past I do believe :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] IPv6 can't be built as module additionally
  2004-05-20 22:50 ` David S. Miller
@ 2004-05-20 23:30   ` Andy Isaacson
  2004-05-20 23:37     ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Isaacson @ 2004-05-20 23:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: Jirka Kosina, linux-kernel, pekkas

On Thu, May 20, 2004 at 03:50:42PM -0700, David S. Miller wrote:
> On Fri, 21 May 2004 00:16:06 +0200 (CEST)
> Jirka Kosina <jikos@jikos.cz> wrote:
> > This is because ipv6-specific functions in drivers/char/random.c 
> > are inside #ifdefs, and as random.c is almost always built directly into 
> > kernel, recompilation of whole kernel can't be avoided.
> 
> This is the smallest problem, several main kernel data structures
> change size based upon whether ipv6 has been enabled in any way
> or not.
> 
> So even with your patch, compiling ipv6 outside of the kernel will
> still not work even though it might build.

Dave, would you be opposed to making IPv6 the default, with IPv4-only a
selectable option under CONFIG_EMBEDDED or whatever umbrella "I know
what I'm doing, let me remove vital parts of the kernel" config option
is considered appropriate?

It seems that the cost of IPv6 is small enough in most scenarios that
virtually everyone should be enabling it, and those who turn it off
should be willing to turn on CONFIG_EMBEDDED or whatever the umbrella
option is called.  I note with dismay that of the 18 arch/*/defconfig
files I perused, 13 do not set CONFIG_IPV6, 3 have =m, and 2 have =y.

-andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] IPv6 can't be built as module additionally
  2004-05-20 23:30   ` Andy Isaacson
@ 2004-05-20 23:37     ` David S. Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2004-05-20 23:37 UTC (permalink / raw)
  To: Andy Isaacson; +Cc: jikos, linux-kernel, pekkas

On Thu, 20 May 2004 18:30:13 -0500
Andy Isaacson <adi@hexapodia.org> wrote:

> Dave, would you be opposed to making IPv6 the default, with IPv4-only a
> selectable option under CONFIG_EMBEDDED or whatever umbrella "I know
> what I'm doing, let me remove vital parts of the kernel" config option
> is considered appropriate?

Not really, this has been discussed to death before.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] IPv6 can't be built as module additionally 
  2004-05-20 22:16 [PATCH] IPv6 can't be built as module additionally Jirka Kosina
  2004-05-20 22:50 ` David S. Miller
@ 2004-05-21 23:36 ` Valdis.Kletnieks
  1 sibling, 0 replies; 5+ messages in thread
From: Valdis.Kletnieks @ 2004-05-21 23:36 UTC (permalink / raw)
  To: Jirka Kosina; +Cc: linux-kernel, pekkas, davem

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

On Fri, 21 May 2004 00:16:06 +0200, Jirka Kosina said:

> It is not possible to build ipv6 for already compiled and running kernel, 
> recompilation of whole kernel, even if building as a module, is typically 
> a must. This is because ipv6-specific functions in drivers/char/random.c 
> are inside #ifdefs, and as random.c is almost always built directly into 
> kernel, recompilation of whole kernel can't be avoided.

What you're getting bit by is the fact that some heavily-used kernel structures
get their size changed when you define CONFIG_IPV6, and *that* forces
the rebuild.

Rebuilding random.o should be relatively fast - that's 1 CC, then a few LD's
to rebuild drivers/char/built-in.o, then drivers/build-in.o, then increment the
kernel build version, and rebuild vmlinux.  Shouldn't be more than 30-40 lines of
output, total.  

In addition, the proposed removal of the ifdef's causes bloat in random.c for
those systems that don't configure it.  So it's a bad fix for the wrong problem...

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-05-21 23:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-20 22:16 [PATCH] IPv6 can't be built as module additionally Jirka Kosina
2004-05-20 22:50 ` David S. Miller
2004-05-20 23:30   ` Andy Isaacson
2004-05-20 23:37     ` David S. Miller
2004-05-21 23:36 ` Valdis.Kletnieks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).