xfrm: use xfrm direction when lookup policy
authorBaker Zhang <baker.kernel@gmail.com>
Tue, 19 Mar 2013 04:24:30 +0000 (04:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Mar 2013 14:35:11 +0000 (10:35 -0400)
commitb5fb82c48b5898c50a9cf75fc957911b56fe1dc5
tree94061aef10d0da5f8b4eec7fab1b1ebb0293f026
parent6fed9592de7bd9c904ab476c3e264a18d1cf3598
xfrm: use xfrm direction when lookup policy

because xfrm policy direction has same value with corresponding
flow direction, so this problem is covered.

In xfrm_lookup and __xfrm_policy_check, flow_cache_lookup is used to
accelerate the lookup.

Flow direction is given to flow_cache_lookup by policy_to_flow_dir.

When the flow cache is mismatched, callback 'resolver' is called.

'resolver' requires xfrm direction,
so convert direction back to xfrm direction.

Signed-off-by: Baker Zhang <baker.zhang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_policy.c