diff options
author | Sandeep Malik <Sandeep.Malik@freescale.com> | 2014-03-13 15:19:14 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-03-17 19:06:24 (GMT) |
commit | cb92b1f8d81a50691cd3fe1747d2a7e04150fd37 (patch) | |
tree | 4fef4090e45c09b803e53be1bb9a1ea431b484bb /net/xfrm | |
parent | 48be2c66c6a015e67de2e4421cacdfaef10628f8 (diff) | |
download | linux-fsl-qoriq-cb92b1f8d81a50691cd3fe1747d2a7e04150fd37.tar.xz |
xfrm_asf: Patch to revert the changes of multi-policy.
This patch reverts the changes for multi-policy being
merged into master branch as the compilation of ASF will break.
Signed-off-by: Sandeep Malik <Sandeep.Malik@freescale.com>
Change-Id: Ifb748be84574daef6ba9adcf0a5db58df5b790b9
Reviewed-on: http://git.am.freescale.net:8181/9807
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Rajan Gupta <rajan.gupta@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_state.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 8df8da9..76d9cce 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1628,10 +1628,9 @@ static void xfrm_replay_timer_handler(unsigned long data) } #ifdef CONFIG_AS_FASTPATH -void xfrm_state_policy_mapping(struct xfrm_state *xfrm, - struct policy_list *pol_lst) +struct xfrm_policy *xfrm_state_policy_mapping(struct xfrm_state *xfrm) { - struct xfrm_policy *xp = 0; + struct xfrm_policy *xp = 0, *matched_pol = 0; struct net *xfrm_net = xs_net(xfrm); struct list_head *list_policy_head = &xfrm_net->xfrm.policy_all; struct xfrm_policy_walk_entry *x; @@ -1640,13 +1639,13 @@ void xfrm_state_policy_mapping(struct xfrm_state *xfrm, if (!list_policy_head) { printk(KERN_INFO "No Security Policies in the system\n"); - return; + return matched_pol; } x = list_first_entry(list_policy_head, struct xfrm_policy_walk_entry, all); if (!x) { printk(KERN_INFO "Security Policies list is empty\n"); - return; + return matched_pol; } if (xfrm->props.family == AF_INET) { list_for_each_entry_from(x, list_policy_head, all) { @@ -1660,7 +1659,9 @@ void xfrm_state_policy_mapping(struct xfrm_state *xfrm, tmpl->saddr.a4 == xfrm->props.saddr.a4 && xfrm->props.reqid == tmpl->reqid && xfrm->props.mode == tmpl->mode) { - pol_lst->xpol[pol_lst->nr_pol++] = xp; + matched_pol = xp; + xfrm->asf_sa_direction = dir; + break; } } } else if (xfrm->props.family == AF_INET6) { @@ -1677,12 +1678,15 @@ void xfrm_state_policy_mapping(struct xfrm_state *xfrm, xfrm->props.saddr.a6, 16) && xfrm->props.reqid == tmpl->reqid && xfrm->props.mode == tmpl->mode) { - pol_lst->xpol[pol_lst->nr_pol++] = xp; + matched_pol = xp; + xfrm->asf_sa_direction = dir; + break; } } - } + } else + return NULL; - return; + return matched_pol; } EXPORT_SYMBOL(xfrm_state_policy_mapping); #endif |