Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c783e8a

Browse files
author
Terence Tritton
committed
Reapply "xfrm: policy: remove remaining use of inexact list"
This reverts commit 8f3ee7f. Reason of revert: Android platform has been updated to reolve this issue - aosp/3303667 Bug: 367633876 Change-Id: I05908cf3c9ff7c6427ff4da3ec5d8de9f58d5a54 Signed-off-by: Terence Tritton <[email protected]>
1 parent 82bcea9 commit c783e8a

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

include/net/xfrm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@ struct xfrm_policy {
585585
u16 family;
586586
struct xfrm_sec_ctx *security;
587587
struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH];
588-
struct hlist_node bydst_inexact_list;
589588
struct rcu_head rcu;
590589

591590
struct xfrm_dev_offload xdo;

net/xfrm/xfrm_policy.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ xfrm_policy_inexact_lookup_rcu(struct net *net,
201201
static struct xfrm_policy *
202202
xfrm_policy_insert_list(struct hlist_head *chain, struct xfrm_policy *policy,
203203
bool excl);
204-
static void xfrm_policy_insert_inexact_list(struct hlist_head *chain,
205-
struct xfrm_policy *policy);
206204

207205
static bool
208206
xfrm_policy_find_inexact_candidates(struct xfrm_pol_inexact_candidates *cand,
@@ -415,7 +413,6 @@ struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp)
415413
if (policy) {
416414
write_pnet(&policy->xp_net, net);
417415
INIT_LIST_HEAD(&policy->walk.all);
418-
INIT_HLIST_NODE(&policy->bydst_inexact_list);
419416
INIT_HLIST_NODE(&policy->bydst);
420417
INIT_HLIST_NODE(&policy->byidx);
421418
rwlock_init(&policy->lock);
@@ -1233,9 +1230,6 @@ xfrm_policy_inexact_insert(struct xfrm_policy *policy, u8 dir, int excl)
12331230
return ERR_PTR(-EEXIST);
12341231
}
12351232

1236-
chain = &net->xfrm.policy_inexact[dir];
1237-
xfrm_policy_insert_inexact_list(chain, policy);
1238-
12391233
if (delpol)
12401234
__xfrm_policy_inexact_prune_bin(bin, false);
12411235

@@ -1343,7 +1337,6 @@ static void xfrm_hash_rebuild(struct work_struct *work)
13431337
continue;
13441338

13451339
hlist_del_rcu(&policy->bydst);
1346-
hlist_del_init(&policy->bydst_inexact_list);
13471340

13481341
newpos = NULL;
13491342
dir = xfrm_policy_id2dir(policy->index);
@@ -1513,36 +1506,6 @@ static const struct rhashtable_params xfrm_pol_inexact_params = {
15131506
.automatic_shrinking = true,
15141507
};
15151508

1516-
static void xfrm_policy_insert_inexact_list(struct hlist_head *chain,
1517-
struct xfrm_policy *policy)
1518-
{
1519-
struct xfrm_policy *pol, *delpol = NULL;
1520-
struct hlist_node *newpos = NULL;
1521-
1522-
hlist_for_each_entry(pol, chain, bydst_inexact_list) {
1523-
if (pol->type == policy->type &&
1524-
pol->if_id == policy->if_id &&
1525-
!selector_cmp(&pol->selector, &policy->selector) &&
1526-
xfrm_policy_mark_match(&policy->mark, pol) &&
1527-
xfrm_sec_ctx_match(pol->security, policy->security) &&
1528-
!WARN_ON(delpol)) {
1529-
delpol = pol;
1530-
if (policy->priority > pol->priority)
1531-
continue;
1532-
} else if (policy->priority >= pol->priority) {
1533-
newpos = &pol->bydst_inexact_list;
1534-
continue;
1535-
}
1536-
if (delpol)
1537-
break;
1538-
}
1539-
1540-
if (newpos && policy->xdo.type != XFRM_DEV_OFFLOAD_PACKET)
1541-
hlist_add_behind_rcu(&policy->bydst_inexact_list, newpos);
1542-
else
1543-
hlist_add_head_rcu(&policy->bydst_inexact_list, chain);
1544-
}
1545-
15461509
static struct xfrm_policy *xfrm_policy_insert_list(struct hlist_head *chain,
15471510
struct xfrm_policy *policy,
15481511
bool excl)
@@ -2344,7 +2307,6 @@ static struct xfrm_policy *__xfrm_policy_unlink(struct xfrm_policy *pol,
23442307
/* Socket policies are not hashed. */
23452308
if (!hlist_unhashed(&pol->bydst)) {
23462309
hlist_del_rcu(&pol->bydst);
2347-
hlist_del_init(&pol->bydst_inexact_list);
23482310
hlist_del(&pol->byidx);
23492311
}
23502312

0 commit comments

Comments
 (0)