aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorMasahide NAKAMURA <nakam@linux-ipv6.org>2006-08-23 20:57:28 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:06:36 -0400
commitaee5adb4307c4c63a4dc5f3b49984d76f8a71b5b (patch)
treeb2daac197259c535d66749617ede6f8479b355a4 /net/ipv6
parenteb2971b68a7d17a7d0fa2c7fc6fbc4bfe41cd694 (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.c3
-rw-r--r--net/ipv6/esp6.c3
-rw-r--r--net/ipv6/ipcomp6.c1
-rw-r--r--net/ipv6/ipv6_syms.c1
-rw-r--r--net/ipv6/xfrm6_mode_transport.c2
-rw-r--r--net/ipv6/xfrm6_output.c6
6 files changed, 13 insertions, 3 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 60954fc7eb36..6c0aa51319a5 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
441static struct inet6_protocol ah6_protocol = { 442static struct inet6_protocol ah6_protocol = {
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 2b8e52e1d0ab..ae50b9511151 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
385static struct inet6_protocol esp6_protocol = { 386static struct inet6_protocol esp6_protocol = {
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 19eba8d9f851..ad9c6e824e62 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
466static struct inet6_protocol ipcomp6_protocol = 467static struct inet6_protocol ipcomp6_protocol =
diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c
index dd4d1ce77769..e1a741612888 100644
--- a/net/ipv6/ipv6_syms.c
+++ b/net/ipv6/ipv6_syms.c
@@ -31,6 +31,7 @@ EXPORT_SYMBOL(ipv6_chk_addr);
31EXPORT_SYMBOL(in6_dev_finish_destroy); 31EXPORT_SYMBOL(in6_dev_finish_destroy);
32#ifdef CONFIG_XFRM 32#ifdef CONFIG_XFRM
33EXPORT_SYMBOL(xfrm6_rcv); 33EXPORT_SYMBOL(xfrm6_rcv);
34EXPORT_SYMBOL(xfrm6_find_1stfragopt);
34#endif 35#endif
35EXPORT_SYMBOL(rt6_lookup); 36EXPORT_SYMBOL(rt6_lookup);
36EXPORT_SYMBOL(ipv6_push_nfrag_opts); 37EXPORT_SYMBOL(ipv6_push_nfrag_opts);
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c
index 711d713e36d8..a5dce216024d 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 26f18869f77b..b4628fbf8ff5 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
20int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
21 u8 **prevhdr)
22{
23 return ip6_find_1stfragopt(skb, prevhdr);
24}
25
20static int xfrm6_tunnel_check_size(struct sk_buff *skb) 26static int xfrm6_tunnel_check_size(struct sk_buff *skb)
21{ 27{
22 int mtu, ret = 0; 28 int mtu, ret = 0;