diff options
author | Kazunori MIYAZAWA <miyazawa@linux-ipv6.org> | 2007-02-13 15:55:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-02-13 15:55:55 -0500 |
commit | 73d605d1abbd70ef67b7660cf2ff177259960756 (patch) | |
tree | 3b183bc597044785eef7cc8efefb41fbac097bf5 /net/ipv6/xfrm6_tunnel.c | |
parent | c73cb5a2d607b5b95a06a54d8291ddb659b348b6 (diff) |
[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.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index fb0228772f01..ee4b84a33ff4 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c | |||
@@ -339,17 +339,29 @@ static struct xfrm6_tunnel xfrm6_tunnel_handler = { | |||
339 | .priority = 2, | 339 | .priority = 2, |
340 | }; | 340 | }; |
341 | 341 | ||
342 | static struct xfrm6_tunnel xfrm46_tunnel_handler = { | ||
343 | .handler = xfrm6_tunnel_rcv, | ||
344 | .err_handler = xfrm6_tunnel_err, | ||
345 | .priority = 2, | ||
346 | }; | ||
347 | |||
342 | static int __init xfrm6_tunnel_init(void) | 348 | static int __init xfrm6_tunnel_init(void) |
343 | { | 349 | { |
344 | if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) | 350 | if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) |
345 | return -EAGAIN; | 351 | return -EAGAIN; |
346 | 352 | ||
347 | if (xfrm6_tunnel_register(&xfrm6_tunnel_handler)) { | 353 | if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) { |
354 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); | ||
355 | return -EAGAIN; | ||
356 | } | ||
357 | if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) { | ||
358 | xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6); | ||
348 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); | 359 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); |
349 | return -EAGAIN; | 360 | return -EAGAIN; |
350 | } | 361 | } |
351 | if (xfrm6_tunnel_spi_init() < 0) { | 362 | if (xfrm6_tunnel_spi_init() < 0) { |
352 | xfrm6_tunnel_deregister(&xfrm6_tunnel_handler); | 363 | xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET); |
364 | xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6); | ||
353 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); | 365 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); |
354 | return -EAGAIN; | 366 | return -EAGAIN; |
355 | } | 367 | } |
@@ -359,7 +371,8 @@ static int __init xfrm6_tunnel_init(void) | |||
359 | static void __exit xfrm6_tunnel_fini(void) | 371 | static void __exit xfrm6_tunnel_fini(void) |
360 | { | 372 | { |
361 | xfrm6_tunnel_spi_fini(); | 373 | xfrm6_tunnel_spi_fini(); |
362 | xfrm6_tunnel_deregister(&xfrm6_tunnel_handler); | 374 | xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET); |
375 | xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6); | ||
363 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); | 376 | xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); |
364 | } | 377 | } |
365 | 378 | ||