int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
int encap_type)
{
+ XFRM_SPI_SKB_CB(skb)->family = AF_INET;
XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
return xfrm_input(skb, nexthdr, spi, encap_type);
}
int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi)
{
+ XFRM_SPI_SKB_CB(skb)->family = AF_INET6;
XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr);
return xfrm_input(skb, nexthdr, spi, 0);
}
__be32 seq;
struct xfrm_state *x;
xfrm_address_t *daddr;
+ unsigned int family;
int decaps = 0;
int async = 0;
daddr = (xfrm_address_t *)(skb_network_header(skb) +
XFRM_SPI_SKB_CB(skb)->daddroff);
+ family = XFRM_SPI_SKB_CB(skb)->family;
seq = 0;
if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
if (skb->sp->len == XFRM_MAX_DEPTH)
goto drop;
- x = xfrm_state_lookup(daddr, spi, nexthdr, AF_INET);
+ x = xfrm_state_lookup(daddr, spi, nexthdr, family);
if (x == NULL)
goto drop;
* transport mode so the outer address is identical.
*/
daddr = &x->id.daddr;
+ family = x->outer_mode->afinfo->family;
err = xfrm_parse_spi(skb, nexthdr, &spi, &seq);
if (err < 0)