aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_tunnel.c
diff options
context:
space:
mode:
authorKazunori MIYAZAWA <miyazawa@linux-ipv6.org>2007-02-13 12:55:55 -0800
committerDavid S. Miller <davem@davemloft.net>2007-02-13 12:55:55 -0800
commit73d605d1abbd70ef67b7660cf2ff177259960756 (patch)
tree3b183bc597044785eef7cc8efefb41fbac097bf5 /net/ipv6/xfrm6_tunnel.c
parentc73cb5a2d607b5b95a06a54d8291ddb659b348b6 (diff)
downloadkernel_samsung_espresso10-73d605d1abbd70ef67b7660cf2ff177259960756.zip
kernel_samsung_espresso10-73d605d1abbd70ef67b7660cf2ff177259960756.tar.gz
kernel_samsung_espresso10-73d605d1abbd70ef67b7660cf2ff177259960756.tar.bz2
[IPSEC]: changing API of xfrm6_tunnel_register
This patch changes xfrm6_tunnel register and deregister interface to prepare for solving the conflict of device tunnels with inter address family IPsec tunnel. There is no device which conflicts with IPv4 over IPv6 IPsec tunnel. Signed-off-by: Kazunori MIYAZAWA <miyazawa@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/xfrm6_tunnel.c')
-rw-r--r--net/ipv6/xfrm6_tunnel.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index fb02287..ee4b84a 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -339,17 +339,29 @@ static struct xfrm6_tunnel xfrm6_tunnel_handler = {
.priority = 2,
};
+static struct xfrm6_tunnel xfrm46_tunnel_handler = {
+ .handler = xfrm6_tunnel_rcv,
+ .err_handler = xfrm6_tunnel_err,
+ .priority = 2,
+};
+
static int __init xfrm6_tunnel_init(void)
{
if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
return -EAGAIN;
- if (xfrm6_tunnel_register(&xfrm6_tunnel_handler)) {
+ if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) {
+ xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
+ return -EAGAIN;
+ }
+ if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) {
+ xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
return -EAGAIN;
}
if (xfrm6_tunnel_spi_init() < 0) {
- xfrm6_tunnel_deregister(&xfrm6_tunnel_handler);
+ xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
+ xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
return -EAGAIN;
}
@@ -359,7 +371,8 @@ static int __init xfrm6_tunnel_init(void)
static void __exit xfrm6_tunnel_fini(void)
{
xfrm6_tunnel_spi_fini();
- xfrm6_tunnel_deregister(&xfrm6_tunnel_handler);
+ xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
+ xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
}