diff options
author | Masahide NAKAMURA <nakam@linux-ipv6.org> | 2006-09-22 18:05:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-09-22 18:05:15 -0400 |
commit | 7e49e6de30efa716614e280d97963c570f3acf29 (patch) | |
tree | 8eaef9d40300d16a7675722e082c5d8ab2a53d40 /net/ipv6/ipcomp6.c | |
parent | 77d16f450ae0452d7d4b009f78debb1294fb435c (diff) |
[XFRM]: Add XFRM_MODE_xxx for future use.
Transformation mode is used as either IPsec transport or tunnel.
It is required to add two more items, route optimization and inbound trigger
for Mobile IPv6.
Based on MIPL2 kernel patch.
This patch was also written by: Ville Nuorvala <vnuorval@tcs.hut.fi>
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/ipcomp6.c')
-rw-r--r-- | net/ipv6/ipcomp6.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index a81e9e9d93bd..19eba8d9f851 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -212,7 +212,7 @@ static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x) | |||
212 | memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); | 212 | memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); |
213 | memcpy(&t->sel, &x->sel, sizeof(t->sel)); | 213 | memcpy(&t->sel, &x->sel, sizeof(t->sel)); |
214 | t->props.family = AF_INET6; | 214 | t->props.family = AF_INET6; |
215 | t->props.mode = 1; | 215 | t->props.mode = XFRM_MODE_TUNNEL; |
216 | memcpy(t->props.saddr.a6, x->props.saddr.a6, sizeof(struct in6_addr)); | 216 | memcpy(t->props.saddr.a6, x->props.saddr.a6, sizeof(struct in6_addr)); |
217 | 217 | ||
218 | if (xfrm_init_state(t)) | 218 | if (xfrm_init_state(t)) |
@@ -417,7 +417,7 @@ static int ipcomp6_init_state(struct xfrm_state *x) | |||
417 | goto out; | 417 | goto out; |
418 | 418 | ||
419 | x->props.header_len = 0; | 419 | x->props.header_len = 0; |
420 | if (x->props.mode) | 420 | if (x->props.mode == XFRM_MODE_TUNNEL) |
421 | x->props.header_len += sizeof(struct ipv6hdr); | 421 | x->props.header_len += sizeof(struct ipv6hdr); |
422 | 422 | ||
423 | mutex_lock(&ipcomp6_resource_mutex); | 423 | mutex_lock(&ipcomp6_resource_mutex); |
@@ -429,7 +429,7 @@ static int ipcomp6_init_state(struct xfrm_state *x) | |||
429 | goto error; | 429 | goto error; |
430 | mutex_unlock(&ipcomp6_resource_mutex); | 430 | mutex_unlock(&ipcomp6_resource_mutex); |
431 | 431 | ||
432 | if (x->props.mode) { | 432 | if (x->props.mode == XFRM_MODE_TUNNEL) { |
433 | err = ipcomp6_tunnel_attach(x); | 433 | err = ipcomp6_tunnel_attach(x); |
434 | if (err) | 434 | if (err) |
435 | goto error_tunnel; | 435 | goto error_tunnel; |