Commit 30e224d7 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

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

Makes IPv4 ip_rcv registration happen last in af_inet.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a31488ca
...@@ -1009,6 +1009,15 @@ static int __init init_ipv4_mibs(void) ...@@ -1009,6 +1009,15 @@ static int __init init_ipv4_mibs(void)
static int ipv4_proc_init(void); static int ipv4_proc_init(void);
extern void ipfrag_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) static int __init inet_init(void)
{ {
struct sk_buff *dummy_skb; struct sk_buff *dummy_skb;
...@@ -1102,6 +1111,8 @@ static int __init inet_init(void) ...@@ -1102,6 +1111,8 @@ static int __init inet_init(void)
ipfrag_init(); ipfrag_init();
dev_add_pack(&ip_packet_type);
rc = 0; rc = 0;
out: out:
return rc; return rc;
......
...@@ -1328,23 +1328,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar ...@@ -1328,23 +1328,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
ip_rt_put(rt); 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) void __init ip_init(void)
{ {
dev_add_pack(&ip_packet_type);
ip_rt_init(); ip_rt_init();
inet_initpeers(); inet_initpeers();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment