aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mip6.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-14 00:36:51 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:41 -0500
commitf04e7e8d7f175c05bbde3ae748bf2541da53721d (patch)
tree0e9a61e66fa507fc389d3e85917eaeb614cc9525 /net/ipv6/mip6.c
parentfff693888012806370c98c601fbaa141fb12dfca (diff)
[IPSEC]: Replace x->type->{local,remote}_addr with flags
The functions local_addr and remote_addr are more than what they're needed for. The same thing can be done easily with flags on the type object. This patch does that and simplifies the wrapper functions in xfrm6_policy accordingly. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mip6.c')
-rw-r--r--net/ipv6/mip6.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 7fd841d41019..edfd9cdd721c 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -34,11 +34,6 @@
34#include <net/xfrm.h> 34#include <net/xfrm.h>
35#include <net/mip6.h> 35#include <net/mip6.h>
36 36
37static xfrm_address_t *mip6_xfrm_addr(struct xfrm_state *x, xfrm_address_t *addr)
38{
39 return x->coaddr;
40}
41
42static inline unsigned int calc_padlen(unsigned int len, unsigned int n) 37static inline unsigned int calc_padlen(unsigned int len, unsigned int n)
43{ 38{
44 return (n - len + 16) & 0x7; 39 return (n - len + 16) & 0x7;
@@ -337,14 +332,13 @@ static struct xfrm_type mip6_destopt_type =
337 .description = "MIP6DESTOPT", 332 .description = "MIP6DESTOPT",
338 .owner = THIS_MODULE, 333 .owner = THIS_MODULE,
339 .proto = IPPROTO_DSTOPTS, 334 .proto = IPPROTO_DSTOPTS,
340 .flags = XFRM_TYPE_NON_FRAGMENT, 335 .flags = XFRM_TYPE_NON_FRAGMENT | XFRM_TYPE_LOCAL_COADDR,
341 .init_state = mip6_destopt_init_state, 336 .init_state = mip6_destopt_init_state,
342 .destructor = mip6_destopt_destroy, 337 .destructor = mip6_destopt_destroy,
343 .input = mip6_destopt_input, 338 .input = mip6_destopt_input,
344 .output = mip6_destopt_output, 339 .output = mip6_destopt_output,
345 .reject = mip6_destopt_reject, 340 .reject = mip6_destopt_reject,
346 .hdr_offset = mip6_destopt_offset, 341 .hdr_offset = mip6_destopt_offset,
347 .local_addr = mip6_xfrm_addr,
348}; 342};
349 343
350static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb) 344static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb)
@@ -467,13 +461,12 @@ static struct xfrm_type mip6_rthdr_type =
467 .description = "MIP6RT", 461 .description = "MIP6RT",
468 .owner = THIS_MODULE, 462 .owner = THIS_MODULE,
469 .proto = IPPROTO_ROUTING, 463 .proto = IPPROTO_ROUTING,
470 .flags = XFRM_TYPE_NON_FRAGMENT, 464 .flags = XFRM_TYPE_NON_FRAGMENT | XFRM_TYPE_REMOTE_COADDR,
471 .init_state = mip6_rthdr_init_state, 465 .init_state = mip6_rthdr_init_state,
472 .destructor = mip6_rthdr_destroy, 466 .destructor = mip6_rthdr_destroy,
473 .input = mip6_rthdr_input, 467 .input = mip6_rthdr_input,
474 .output = mip6_rthdr_output, 468 .output = mip6_rthdr_output,
475 .hdr_offset = mip6_rthdr_offset, 469 .hdr_offset = mip6_rthdr_offset,
476 .remote_addr = mip6_xfrm_addr,
477}; 470};
478 471
479static int __init mip6_init(void) 472static int __init mip6_init(void)