[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>
This commit is contained in:
YOSHIFUJI Hideaki
2008-02-22 14:48:22 +09:00
parent df8ea19b5d
commit 9bb182a700
2 changed files with 58 additions and 10 deletions

View File

@@ -1045,6 +1045,23 @@ xfrm_address_t *xfrm_flowi_saddr(struct flowi *fl, unsigned short family)
return NULL;
}
static __inline__
void xfrm_flowi_addr_get(struct flowi *fl,
xfrm_address_t *saddr, xfrm_address_t *daddr,
unsigned short family)
{
switch(family) {
case AF_INET:
memcpy(&saddr->a4, &fl->fl4_src, sizeof(saddr->a4));
memcpy(&daddr->a4, &fl->fl4_dst, sizeof(daddr->a4));
break;
case AF_INET6:
ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->fl6_src);
ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->fl6_dst);
break;
}
}
static __inline__ int
__xfrm4_state_addr_check(struct xfrm_state *x,
xfrm_address_t *daddr, xfrm_address_t *saddr)