Subject: Re: Recent net-2.6.22 patches break bootup!

From: Thomas Graf <[email-masked]>
Date: Fri, 23 Mar 2007 00:47:04 +0100

* Stephen Hemminger <[email-masked]> 2007-03-22 14:27
> Something is broken now.  If I boot the system (Fedora) it gets to:
> 
> Bringing up loopback interface:  RTNETLINK answers: Invalid argument
> Dump terminated
> RTNETLINK answers: Invalid argument
> ....
> 
> tg3 device eth0 does not seem to be present, delaying initialization
> 
> 
> then it hangs because cups won't come up without loopback

Thinko. It always returned the first message handler of a rtnl
family.

[RTNL]: Properly return rntl message handler

Signed-off-by: Thomas Graf <[email-masked]>

Index: net-2.6.22/net/core/rtnetlink.c
===================================================================
--- net-2.6.22.orig/net/core/rtnetlink.c	2007-03-23 00:31:37.000000000 +0100
+++ net-2.6.22/net/core/rtnetlink.c	2007-03-23 00:32:52.000000000 +0100
@@ -122,10 +122,10 @@ static rtnl_doit_func rtnl_get_doit(int 
 	struct rtnl_link *tab;
 
 	tab = rtnl_msg_handlers[protocol];
-	if (tab == NULL || tab->doit == NULL)
+	if (tab == NULL || tab[msgindex].doit == NULL)
 		tab = rtnl_msg_handlers[PF_UNSPEC];
 
-	return tab ? tab->doit : NULL;
+	return tab ? tab[msgindex].doit : NULL;
 }
 
 static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
@@ -133,10 +133,10 @@ static rtnl_dumpit_func rtnl_get_dumpit(
 	struct rtnl_link *tab;
 
 	tab = rtnl_msg_handlers[protocol];
-	if (tab == NULL || tab->dumpit == NULL)
+	if (tab == NULL || tab[msgindex].dumpit == NULL)
 		tab = rtnl_msg_handlers[PF_UNSPEC];
 
-	return tab ? tab->dumpit : NULL;
+	return tab ? tab[msgindex].dumpit : NULL;
 }
 
 /**