diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2007-12-11 05:24:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:57:11 -0500 |
commit | 853cbbaaa4ccdf221be5ab6afe967aa9998546b7 (patch) | |
tree | 6b6ff0b340fcff4054c919092fbbadce82dff36c /net/ipv6/reassembly.c | |
parent | 248b238dc960a42aa235057ba0a51a98ae2b0f0d (diff) |
[IPV6]: make frag to return an error at initialization
This patch makes the frag_init to return an error code, so the af_inet6
module can handle the error.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r-- | net/ipv6/reassembly.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 76c88a93b9b5..bf4173daecbb 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -632,11 +632,13 @@ static struct inet6_protocol frag_protocol = | |||
632 | .flags = INET6_PROTO_NOPOLICY, | 632 | .flags = INET6_PROTO_NOPOLICY, |
633 | }; | 633 | }; |
634 | 634 | ||
635 | void __init ipv6_frag_init(void) | 635 | int __init ipv6_frag_init(void) |
636 | { | 636 | { |
637 | if (inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT) < 0) | 637 | int ret; |
638 | printk(KERN_ERR "ipv6_frag_init: Could not register protocol\n"); | ||
639 | 638 | ||
639 | ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT); | ||
640 | if (ret) | ||
641 | goto out; | ||
640 | ip6_frags.ctl = &ip6_frags_ctl; | 642 | ip6_frags.ctl = &ip6_frags_ctl; |
641 | ip6_frags.hashfn = ip6_hashfn; | 643 | ip6_frags.hashfn = ip6_hashfn; |
642 | ip6_frags.constructor = ip6_frag_init; | 644 | ip6_frags.constructor = ip6_frag_init; |
@@ -646,4 +648,12 @@ void __init ipv6_frag_init(void) | |||
646 | ip6_frags.match = ip6_frag_match; | 648 | ip6_frags.match = ip6_frag_match; |
647 | ip6_frags.frag_expire = ip6_frag_expire; | 649 | ip6_frags.frag_expire = ip6_frag_expire; |
648 | inet_frags_init(&ip6_frags); | 650 | inet_frags_init(&ip6_frags); |
651 | out: | ||
652 | return ret; | ||
653 | } | ||
654 | |||
655 | void ipv6_frag_exit(void) | ||
656 | { | ||
657 | inet_frags_fini(&ip6_frags); | ||
658 | inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT); | ||
649 | } | 659 | } |