tree 0a2d6bb1e699a1df9b9350f5c5a235d825673248
parent a31488ca4b8476a8dd301b21388631df52d05c5a
author Herbert Xu <[EMAIL PROTECTED]> Wed, 06 Jul 2005 04:40:10 -0700
committer David S. Miller <[EMAIL PROTECTED]> Wed, 06 Jul 2005 04:40:10 -0700

[IPV4]: Fix crash in ip_rcv while booting related to netconsole

Makes IPv4 ip_rcv registration happen last in af_inet.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 net/ipv4/af_inet.c   |   11 +++++++++++
 net/ipv4/ip_output.c |   15 ---------------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1009,6 +1009,15 @@ static int __init init_ipv4_mibs(void)
 static int ipv4_proc_init(void);
 extern void ipfrag_init(void);
 
+/*
+ *     IP protocol layer initialiser
+ */
+
+static struct packet_type ip_packet_type = {
+       .type = __constant_htons(ETH_P_IP),
+       .func = ip_rcv,
+};
+
 static int __init inet_init(void)
 {
        struct sk_buff *dummy_skb;
@@ -1102,6 +1111,8 @@ static int __init inet_init(void)
 
        ipfrag_init();
 
+       dev_add_pack(&ip_packet_type);
+
        rc = 0;
 out:
        return rc;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1328,23 +1328,8 @@ void ip_send_reply(struct sock *sk, stru
        ip_rt_put(rt);
 }
 
-/*
- *     IP protocol layer initialiser
- */
-
-static struct packet_type ip_packet_type = {
-       .type = __constant_htons(ETH_P_IP),
-       .func = ip_rcv,
-};
-
-/*
- *     IP registers the packet type and then calls the subprotocol initialisers
- */
-
 void __init ip_init(void)
 {
-       dev_add_pack(&ip_packet_type);
-
        ip_rt_init();
        inet_initpeers();
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to