diff options
author | Masahide NAKAMURA <nakam@linux-ipv6.org> | 2006-08-23 20:57:28 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:06:36 -0400 |
commit | aee5adb4307c4c63a4dc5f3b49984d76f8a71b5b (patch) | |
tree | b2daac197259c535d66749617ede6f8479b355a4 /net/ipv6 | |
parent | eb2971b68a7d17a7d0fa2c7fc6fbc4bfe41cd694 (diff) |
[XFRM] STATE: Add a hook to find offset to be inserted header in outbound.
On current kernel, ip6_find_1stfragopt() is used by IPv6 IPsec to find
offset to be inserted header in outbound for transport mode. (BTW, no
usage may be needed for IPv4 case.) Mobile IPv6 requires another
logic for routing header and destination options header
respectively. This patch is common platform for the offset and adopts
it to IPsec.
Based on MIPL2 kernel patch.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ah6.c | 3 | ||||
-rw-r--r-- | net/ipv6/esp6.c | 3 | ||||
-rw-r--r-- | net/ipv6/ipcomp6.c | 1 | ||||
-rw-r--r-- | net/ipv6/ipv6_syms.c | 1 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_transport.c | 2 | ||||
-rw-r--r-- | net/ipv6/xfrm6_output.c | 6 |
6 files changed, 13 insertions, 3 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 60954fc7eb..6c0aa51319 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c | |||
@@ -435,7 +435,8 @@ static struct xfrm_type ah6_type = | |||
435 | .init_state = ah6_init_state, | 435 | .init_state = ah6_init_state, |
436 | .destructor = ah6_destroy, | 436 | .destructor = ah6_destroy, |
437 | .input = ah6_input, | 437 | .input = ah6_input, |
438 | .output = ah6_output | 438 | .output = ah6_output, |
439 | .hdr_offset = xfrm6_find_1stfragopt, | ||
439 | }; | 440 | }; |
440 | 441 | ||
441 | static struct inet6_protocol ah6_protocol = { | 442 | static struct inet6_protocol ah6_protocol = { |
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 2b8e52e1d0..ae50b95111 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -379,7 +379,8 @@ static struct xfrm_type esp6_type = | |||
379 | .destructor = esp6_destroy, | 379 | .destructor = esp6_destroy, |
380 | .get_max_size = esp6_get_max_size, | 380 | .get_max_size = esp6_get_max_size, |
381 | .input = esp6_input, | 381 | .input = esp6_input, |
382 | .output = esp6_output | 382 | .output = esp6_output, |
383 | .hdr_offset = xfrm6_find_1stfragopt, | ||
383 | }; | 384 | }; |
384 | 385 | ||
385 | static struct inet6_protocol esp6_protocol = { | 386 | static struct inet6_protocol esp6_protocol = { |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 19eba8d9f8..ad9c6e824e 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -461,6 +461,7 @@ static struct xfrm_type ipcomp6_type = | |||
461 | .destructor = ipcomp6_destroy, | 461 | .destructor = ipcomp6_destroy, |
462 | .input = ipcomp6_input, | 462 | .input = ipcomp6_input, |
463 | .output = ipcomp6_output, | 463 | .output = ipcomp6_output, |
464 | .hdr_offset = xfrm6_find_1stfragopt, | ||
464 | }; | 465 | }; |
465 | 466 | ||
466 | static struct inet6_protocol ipcomp6_protocol = | 467 | static struct inet6_protocol ipcomp6_protocol = |
diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c index dd4d1ce777..e1a7416128 100644 --- a/net/ipv6/ipv6_syms.c +++ b/net/ipv6/ipv6_syms.c | |||
@@ -31,6 +31,7 @@ EXPORT_SYMBOL(ipv6_chk_addr); | |||
31 | EXPORT_SYMBOL(in6_dev_finish_destroy); | 31 | EXPORT_SYMBOL(in6_dev_finish_destroy); |
32 | #ifdef CONFIG_XFRM | 32 | #ifdef CONFIG_XFRM |
33 | EXPORT_SYMBOL(xfrm6_rcv); | 33 | EXPORT_SYMBOL(xfrm6_rcv); |
34 | EXPORT_SYMBOL(xfrm6_find_1stfragopt); | ||
34 | #endif | 35 | #endif |
35 | EXPORT_SYMBOL(rt6_lookup); | 36 | EXPORT_SYMBOL(rt6_lookup); |
36 | EXPORT_SYMBOL(ipv6_push_nfrag_opts); | 37 | EXPORT_SYMBOL(ipv6_push_nfrag_opts); |
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c index 711d713e36..a5dce21602 100644 --- a/net/ipv6/xfrm6_mode_transport.c +++ b/net/ipv6/xfrm6_mode_transport.c | |||
@@ -35,7 +35,7 @@ static int xfrm6_transport_output(struct sk_buff *skb) | |||
35 | skb_push(skb, x->props.header_len); | 35 | skb_push(skb, x->props.header_len); |
36 | iph = skb->nh.ipv6h; | 36 | iph = skb->nh.ipv6h; |
37 | 37 | ||
38 | hdr_len = ip6_find_1stfragopt(skb, &prevhdr); | 38 | hdr_len = x->type->hdr_offset(x, skb, &prevhdr); |
39 | skb->nh.raw = prevhdr - x->props.header_len; | 39 | skb->nh.raw = prevhdr - x->props.header_len; |
40 | skb->h.raw = skb->data + hdr_len; | 40 | skb->h.raw = skb->data + hdr_len; |
41 | memmove(skb->data, iph, hdr_len); | 41 | memmove(skb->data, iph, hdr_len); |
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 26f18869f7..b4628fbf8f 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c | |||
@@ -17,6 +17,12 @@ | |||
17 | #include <net/ipv6.h> | 17 | #include <net/ipv6.h> |
18 | #include <net/xfrm.h> | 18 | #include <net/xfrm.h> |
19 | 19 | ||
20 | int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | ||
21 | u8 **prevhdr) | ||
22 | { | ||
23 | return ip6_find_1stfragopt(skb, prevhdr); | ||
24 | } | ||
25 | |||
20 | static int xfrm6_tunnel_check_size(struct sk_buff *skb) | 26 | static int xfrm6_tunnel_check_size(struct sk_buff *skb) |
21 | { | 27 | { |
22 | int mtu, ret = 0; | 28 | int mtu, ret = 0; |