[IPSEC]: Fix the address family to refer encap_family
authorKazunori MIYAZAWA <miyazawa@linux-ipv6.org>
Tue, 13 Feb 2007 20:57:16 +0000 (12:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Feb 2007 20:57:16 +0000 (12:57 -0800)
Fix the address family to refer encap_family
when comparing with a kernel generated xfrm_state

Signed-off-by: Kazunori MIYAZAWA <miyazawa@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_policy.c

index c394b413f6511ab27f33508c1caf7d3214e3ff26..946b715db5ec8c708287d8d5ae51a2eb4d77ab8e 100644 (file)
@@ -1550,7 +1550,7 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
              unsigned short family)
 {
        if (xfrm_state_kern(x))
-               return tmpl->optional && !xfrm_state_addr_cmp(tmpl, x, family);
+               return tmpl->optional && !xfrm_state_addr_cmp(tmpl, x, tmpl->encap_family);
        return  x->id.proto == tmpl->id.proto &&
                (x->id.spi == tmpl->id.spi || !tmpl->id.spi) &&
                (x->props.reqid == tmpl->reqid || !tmpl->reqid) &&