aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2007-12-11 05:25:35 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:57:13 -0500
commit7f4e4868f3ce0e946f116c28fa4fe033be5e4ba9 (patch)
tree144add1d4c94a145f7e048a17d91b563f5e6e265 /net/ipv6/udp.c
parent87c3efbfdd1f98af14a1f60ff19f73d9a8d8da98 (diff)
[IPV6]: make the protocol initialization to return an error code
This patchset makes the different protocols to return an error code, so the af_inet6 module can check the initialization was correct or not. The raw6 was taken into account to be consistent with the rest of the protocols, but the registration is at the same place. Because the raw6 has its own init function, the proto and the ops structure can be moved inside the raw6.c file. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index fa640765385e..1e3bd39f54ec 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1016,9 +1016,27 @@ static struct inet_protosw udpv6_protosw = {
1016}; 1016};
1017 1017
1018 1018
1019void __init udpv6_init(void) 1019int __init udpv6_init(void)
1020{ 1020{
1021 if (inet6_add_protocol(&udpv6_protocol, IPPROTO_UDP) < 0) 1021 int ret;
1022 printk(KERN_ERR "udpv6_init: Could not register protocol\n"); 1022
1023 inet6_register_protosw(&udpv6_protosw); 1023 ret = inet6_add_protocol(&udpv6_protocol, IPPROTO_UDP);
1024 if (ret)
1025 goto out;
1026
1027 ret = inet6_register_protosw(&udpv6_protosw);
1028 if (ret)
1029 goto out_udpv6_protocol;
1030out:
1031 return ret;
1032
1033out_udpv6_protocol:
1034 inet6_del_protocol(&udpv6_protocol, IPPROTO_UDP);
1035 goto out;
1036}
1037
1038void __exit udpv6_exit(void)
1039{
1040 inet6_unregister_protosw(&udpv6_protosw);
1041 inet6_del_protocol(&udpv6_protocol, IPPROTO_UDP);
1024} 1042}