Skip to content

Commit 08c2182

Browse files
Florian Westphalklassert
authored andcommitted
xfrm: policy: use recently added helper in more places
No logical change intended. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent e7cd191 commit 08c2182

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

net/xfrm/xfrm_policy.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,11 +1276,7 @@ static void xfrm_hash_rebuild(struct work_struct *work)
12761276
struct xfrm_pol_inexact_bin *bin;
12771277
u8 dbits, sbits;
12781278

1279-
if (policy->walk.dead)
1280-
continue;
1281-
1282-
dir = xfrm_policy_id2dir(policy->index);
1283-
if (dir >= XFRM_POLICY_MAX)
1279+
if (xfrm_policy_is_dead_or_sk(policy))
12841280
continue;
12851281

12861282
if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) {
@@ -1331,13 +1327,8 @@ static void xfrm_hash_rebuild(struct work_struct *work)
13311327

13321328
/* re-insert all policies by order of creation */
13331329
list_for_each_entry_reverse(policy, &net->xfrm.policy_all, walk.all) {
1334-
if (policy->walk.dead)
1335-
continue;
1336-
dir = xfrm_policy_id2dir(policy->index);
1337-
if (dir >= XFRM_POLICY_MAX) {
1338-
/* skip socket policies */
1330+
if (xfrm_policy_is_dead_or_sk(policy))
13391331
continue;
1340-
}
13411332

13421333
hlist_del_rcu(&policy->bydst);
13431334

0 commit comments

Comments
 (0)