[1934] in linux-net channel archive

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

kerneld-support for ip_alias module [PATCH]

daemon@ATHENA.MIT.EDU (Andreas Schultz)
Fri Feb 16 03:43:08 1996

Date: 	Thu, 15 Feb 1996 21:55:31 +0100 (MEZ)
From: Andreas Schultz <aschultz@csmd.cs.Uni-Magdeburg.DE>
To: linux-net@vger.rutgers.edu

Hi,

Recently I tried to compile everything as module and let it then be 
loaded with kerneld. Unfortunatly I started to get messages like:

    modprobe: Can't locate module eth0:0
    net_alias_dev_create(eth0:0): unregistered family==2

at startup. The first message is caused by dev_load while trying to load 
the alias device and the second appears because the ip_alias module is not 
yet loaded.

The following patch lets kerneld load the ip_alias module as needed and 
removes the support for alias devices from dev_load.

I hope, I did it the right way.

Greetings
   Andreas

--- linux/net/core/dev.c.orig	Mon Feb 12 18:57:55 1996
+++ linux/net/core/dev.c	Mon Feb 12 18:59:28 1996
@@ -214,8 +214,15 @@
 
 extern __inline__ void dev_load(const char *name)
 {
-	if(!dev_get(name))
-		request_module(name);
+        char *sptr;
+ 
+        if(!dev_get(name)) {
+#ifdef CONFIG_NET_ALIAS
+                for (sptr=name ; *sptr ; sptr++) if(*sptr==':') break;
+                if (!(*sptr && *(sptr+1)))
+#endif
+                        request_module(name);
+        }
 }
 
 #endif
--- linux/net/core/net_alias.c.orig	Mon Feb 12 18:58:02 1996
+++ linux/net/core/net_alias.c	Mon Feb 12 18:59:35 1996
@@ -30,6 +30,7 @@
  *	
  */
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
@@ -47,6 +48,10 @@
 
 #include <linux/net_alias.h>
 
+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif
+
 /*
  * Only allow the following flags to pass from main device to aliases
  */
@@ -346,13 +351,23 @@
    */
   
   nat = nat_getbytype(family);
-  if (!nat)
-  {
-    printk("net_alias_dev_create(%s:%d): unregistered family==%d\n",
-	   main_dev->name, slot, family);
-    /* *err = -EAFNOSUPPORT; */
-    *err = -EINVAL;
-    return NULL;
+  if (!nat) {
+#ifdef CONFIG_KERNELD
+    char modname[20];
+    sprintf (modname,"netalias-%d", family);
+    request_module(modname);
+
+    nat = nat_getbytype(family);
+    if (!nat) {
+#endif
+      printk("net_alias_dev_create(%s:%d): unregistered family==%d\n",
+             main_dev->name, slot, family);
+      /* *err = -EAFNOSUPPORT; */
+      *err = -EINVAL;
+      return NULL;
+#ifdef CONFIG_KERNELD
+    }
+#endif
   }
   
   /*

 
 


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