mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[IPSEC]: Document that policy direction is derived from the index.
Here is a patch that adds a helper called xfrm_policy_id2dir to document the fact that the policy direction can be and is derived from the index. This is based on a patch by YOSHIFUJI Hideaki and [email protected]. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
140e26fcd5
commit
77d8d7a684
3 changed files with 15 additions and 5 deletions
|
|
@ -163,7 +163,7 @@ static void xfrm_policy_timer(unsigned long data)
|
|||
if (xp->dead)
|
||||
goto out;
|
||||
|
||||
dir = xp->index & 7;
|
||||
dir = xfrm_policy_id2dir(xp->index);
|
||||
|
||||
if (xp->lft.hard_add_expires_seconds) {
|
||||
long tmo = xp->lft.hard_add_expires_seconds +
|
||||
|
|
@ -417,7 +417,7 @@ struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete)
|
|||
struct xfrm_policy *pol, **p;
|
||||
|
||||
write_lock_bh(&xfrm_policy_lock);
|
||||
for (p = &xfrm_policy_list[id & 7]; (pol=*p)!=NULL; p = &pol->next) {
|
||||
for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL; p = &pol->next) {
|
||||
if (pol->index == id) {
|
||||
xfrm_pol_hold(pol);
|
||||
if (delete)
|
||||
|
|
|
|||
Loading…
Reference in a new issue