diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-02-22 00:48:22 -0500 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-24 21:23:57 -0400 |
commit | 9bb182a7007515239091b237fe7169b1328a61d3 (patch) | |
tree | 7be7f556c58c650a547a0db34058f8ffffbf98aa /include | |
parent | df8ea19b5d2e7512095bb1e0737513b8da196d64 (diff) |
[XFRM] MIP6: Fix address keys for routing search.
Each MIPv6 XFRM state (DSTOPT/RH2) holds either destination or source
address to be mangled in the IPv6 header (that is "CoA").
On Inter-MN communication after both nodes binds each other,
they use route optimized traffic two MIPv6 states applied, and
both source and destination address in the IPv6 header
are replaced by the states respectively.
The packet format is correct, however, next-hop routing search
are not.
This patch fixes it by remembering address pairs for later states.
Based on patch from Masahide NAKAMURA <nakam@linux-ipv6.org>.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/xfrm.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index c435620dbb37..bed7d43932f6 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1045,6 +1045,23 @@ xfrm_address_t *xfrm_flowi_saddr(struct flowi *fl, unsigned short family) | |||
1045 | return NULL; | 1045 | return NULL; |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | static __inline__ | ||
1049 | void xfrm_flowi_addr_get(struct flowi *fl, | ||
1050 | xfrm_address_t *saddr, xfrm_address_t *daddr, | ||
1051 | unsigned short family) | ||
1052 | { | ||
1053 | switch(family) { | ||
1054 | case AF_INET: | ||
1055 | memcpy(&saddr->a4, &fl->fl4_src, sizeof(saddr->a4)); | ||
1056 | memcpy(&daddr->a4, &fl->fl4_dst, sizeof(daddr->a4)); | ||
1057 | break; | ||
1058 | case AF_INET6: | ||
1059 | ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->fl6_src); | ||
1060 | ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->fl6_dst); | ||
1061 | break; | ||
1062 | } | ||
1063 | } | ||
1064 | |||
1048 | static __inline__ int | 1065 | static __inline__ int |
1049 | __xfrm4_state_addr_check(struct xfrm_state *x, | 1066 | __xfrm4_state_addr_check(struct xfrm_state *x, |
1050 | xfrm_address_t *daddr, xfrm_address_t *saddr) | 1067 | xfrm_address_t *daddr, xfrm_address_t *saddr) |