diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-07-05 17:40:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-05 17:40:10 -0400 |
commit | 30e224d76f34e041c30df66a4dcbeeb53556ea3f (patch) | |
tree | 0a2d6bb1e699a1df9b9350f5c5a235d825673248 | |
parent | a31488ca4b8476a8dd301b21388631df52d05c5a (diff) |
[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 <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/af_inet.c | 11 | ||||
-rw-r--r-- | 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 index 658e7977924d..ef7468376ae6 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1009,6 +1009,15 @@ static int __init init_ipv4_mibs(void) | |||
1009 | static int ipv4_proc_init(void); | 1009 | static int ipv4_proc_init(void); |
1010 | extern void ipfrag_init(void); | 1010 | extern void ipfrag_init(void); |
1011 | 1011 | ||
1012 | /* | ||
1013 | * IP protocol layer initialiser | ||
1014 | */ | ||
1015 | |||
1016 | static struct packet_type ip_packet_type = { | ||
1017 | .type = __constant_htons(ETH_P_IP), | ||
1018 | .func = ip_rcv, | ||
1019 | }; | ||
1020 | |||
1012 | static int __init inet_init(void) | 1021 | static int __init inet_init(void) |
1013 | { | 1022 | { |
1014 | struct sk_buff *dummy_skb; | 1023 | struct sk_buff *dummy_skb; |
@@ -1102,6 +1111,8 @@ static int __init inet_init(void) | |||
1102 | 1111 | ||
1103 | ipfrag_init(); | 1112 | ipfrag_init(); |
1104 | 1113 | ||
1114 | dev_add_pack(&ip_packet_type); | ||
1115 | |||
1105 | rc = 0; | 1116 | rc = 0; |
1106 | out: | 1117 | out: |
1107 | return rc; | 1118 | return rc; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 1bfa49eda96f..9de83e6e0f1d 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1328,23 +1328,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1328 | ip_rt_put(rt); | 1328 | ip_rt_put(rt); |
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | /* | ||
1332 | * IP protocol layer initialiser | ||
1333 | */ | ||
1334 | |||
1335 | static struct packet_type ip_packet_type = { | ||
1336 | .type = __constant_htons(ETH_P_IP), | ||
1337 | .func = ip_rcv, | ||
1338 | }; | ||
1339 | |||
1340 | /* | ||
1341 | * IP registers the packet type and then calls the subprotocol initialisers | ||
1342 | */ | ||
1343 | |||
1344 | void __init ip_init(void) | 1331 | void __init ip_init(void) |
1345 | { | 1332 | { |
1346 | dev_add_pack(&ip_packet_type); | ||
1347 | |||
1348 | ip_rt_init(); | 1333 | ip_rt_init(); |
1349 | inet_initpeers(); | 1334 | inet_initpeers(); |
1350 | 1335 | ||