aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udplite.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/udplite.c')
-rw-r--r--net/ipv6/udplite.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 5a0379f71415..87d4202522ee 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -26,7 +26,7 @@ static void udplitev6_err(struct sk_buff *skb,
26 struct inet6_skb_parm *opt, 26 struct inet6_skb_parm *opt,
27 int type, int code, int offset, __be32 info) 27 int type, int code, int offset, __be32 info)
28{ 28{
29 return __udp6_lib_err(skb, opt, type, code, offset, info, udplite_hash); 29 __udp6_lib_err(skb, opt, type, code, offset, info, udplite_hash);
30} 30}
31 31
32static struct inet6_protocol udplitev6_protocol = { 32static struct inet6_protocol udplitev6_protocol = {
@@ -77,12 +77,29 @@ static struct inet_protosw udplite6_protosw = {
77 .flags = INET_PROTOSW_PERMANENT, 77 .flags = INET_PROTOSW_PERMANENT,
78}; 78};
79 79
80void __init udplitev6_init(void) 80int __init udplitev6_init(void)
81{ 81{
82 if (inet6_add_protocol(&udplitev6_protocol, IPPROTO_UDPLITE) < 0) 82 int ret;
83 printk(KERN_ERR "%s: Could not register.\n", __FUNCTION__);
84 83
85 inet6_register_protosw(&udplite6_protosw); 84 ret = inet6_add_protocol(&udplitev6_protocol, IPPROTO_UDPLITE);
85 if (ret)
86 goto out;
87
88 ret = inet6_register_protosw(&udplite6_protosw);
89 if (ret)
90 goto out_udplitev6_protocol;
91out:
92 return ret;
93
94out_udplitev6_protocol:
95 inet6_del_protocol(&udplitev6_protocol, IPPROTO_UDPLITE);
96 goto out;
97}
98
99void udplitev6_exit(void)
100{
101 inet6_unregister_protosw(&udplite6_protosw);
102 inet6_del_protocol(&udplitev6_protocol, IPPROTO_UDPLITE);
86} 103}
87 104
88#ifdef CONFIG_PROC_FS 105#ifdef CONFIG_PROC_FS