summaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
authorDaniel Lezcano2007-12-11 11:24:29 +0100
committerDavid S. Miller2008-01-28 23:57:11 +0100
commit853cbbaaa4ccdf221be5ab6afe967aa9998546b7 (patch)
tree6b6ff0b340fcff4054c919092fbbadce82dff36c /net/ipv6/reassembly.c
parent[IPV6]: make extended headers to return an error at initialization (diff)
downloadkernel-qcow2-linux-853cbbaaa4ccdf221be5ab6afe967aa9998546b7.tar.gz
kernel-qcow2-linux-853cbbaaa4ccdf221be5ab6afe967aa9998546b7.tar.xz
kernel-qcow2-linux-853cbbaaa4ccdf221be5ab6afe967aa9998546b7.zip
[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.c16
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 =
.flags = INET6_PROTO_NOPOLICY,
};
-void __init ipv6_frag_init(void)
+int __init ipv6_frag_init(void)
{
- if (inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT) < 0)
- printk(KERN_ERR "ipv6_frag_init: Could not register protocol\n");
+ int ret;
+ ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
+ if (ret)
+ goto out;
ip6_frags.ctl = &ip6_frags_ctl;
ip6_frags.hashfn = ip6_hashfn;
ip6_frags.constructor = ip6_frag_init;
@@ -646,4 +648,12 @@ void __init ipv6_frag_init(void)
ip6_frags.match = ip6_frag_match;
ip6_frags.frag_expire = ip6_frag_expire;
inet_frags_init(&ip6_frags);
+out:
+ return ret;
+}
+
+void ipv6_frag_exit(void)
+{
+ inet_frags_fini(&ip6_frags);
+ inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
}