diff options
author | Sandeep Malik <Sandeep.Malik@freescale.com> | 2014-02-15 14:26:15 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-03-13 21:13:36 (GMT) |
commit | 1607a6134987fd152f6a5f6f92e5b3f2680ae564 (patch) | |
tree | efe2df59180ad50ad87f7453a7c1947e1c766918 /net/xfrm | |
parent | aaee7afb586e2a831505435e62d431b233181b33 (diff) | |
download | linux-fsl-qoriq-1607a6134987fd152f6a5f6f92e5b3f2680ae564.tar.xz |
asf_ipsec_linux: Patch to add support for multiple SPD entries mapping to single SA entry.
This patch adds the support for multiple SPD entries
to map to single SA entry.
CQ: ENGR00267797
Signed-off-by: Sandeep Malik <Sandeep.Malik@freescale.com>
Change-Id: I2db3620f9b8262d047c1ffc847d4337e73be02f7
Reviewed-on: http://git.am.freescale.net:8181/8828
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Nipun Gupta <Nipun.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, 9 insertions, 13 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 76d9cce..8df8da9 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1628,9 +1628,10 @@ static void xfrm_replay_timer_handler(unsigned long data) } #ifdef CONFIG_AS_FASTPATH -struct xfrm_policy *xfrm_state_policy_mapping(struct xfrm_state *xfrm) +void xfrm_state_policy_mapping(struct xfrm_state *xfrm, + struct policy_list *pol_lst) { - struct xfrm_policy *xp = 0, *matched_pol = 0; + struct xfrm_policy *xp = 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; @@ -1639,13 +1640,13 @@ struct xfrm_policy *xfrm_state_policy_mapping(struct xfrm_state *xfrm) if (!list_policy_head) { printk(KERN_INFO "No Security Policies in the system\n"); - return matched_pol; + return; } 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 matched_pol; + return; } if (xfrm->props.family == AF_INET) { list_for_each_entry_from(x, list_policy_head, all) { @@ -1659,9 +1660,7 @@ struct xfrm_policy *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) { - matched_pol = xp; - xfrm->asf_sa_direction = dir; - break; + pol_lst->xpol[pol_lst->nr_pol++] = xp; } } } else if (xfrm->props.family == AF_INET6) { @@ -1678,15 +1677,12 @@ struct xfrm_policy *xfrm_state_policy_mapping(struct xfrm_state *xfrm) xfrm->props.saddr.a6, 16) && xfrm->props.reqid == tmpl->reqid && xfrm->props.mode == tmpl->mode) { - matched_pol = xp; - xfrm->asf_sa_direction = dir; - break; + pol_lst->xpol[pol_lst->nr_pol++] = xp; } } - } else - return NULL; + } - return matched_pol; + return; } EXPORT_SYMBOL(xfrm_state_policy_mapping); #endif |