Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34623
b: refs/heads/master
c: acba48e
h: refs/heads/master
i:
  34621: 811a122
  34619: ed9f6e4
  34615: cb8bf07
  34607: acf59ce
  34591: 4095a9b
  34559: e8c2e9d
v: v3
  • Loading branch information
David S. Miller committed Sep 22, 2006
1 parent cca4ede commit 6c79798
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65e3d72654d9a33cdccd5c19777a5515ae9dd37d
refs/heads/master: acba48e1a3c95082af1e12c5efaaca3506103a92
19 changes: 10 additions & 9 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(u8 type, struct flowi *fl,
xfrm_address_t *daddr, *saddr;
struct hlist_node *entry;
struct hlist_head *chain;
u32 priority = ~0U;

daddr = xfrm_flowi_daddr(fl, family);
saddr = xfrm_flowi_saddr(fl, family);
Expand All @@ -919,21 +920,21 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(u8 type, struct flowi *fl,
ret = NULL;
hlist_for_each_entry(pol, entry, chain, bydst) {
if (xfrm_policy_match(pol, fl, type, family, dir)) {
xfrm_pol_hold(pol);
ret = pol;
priority = ret->priority;
break;
}
}
if (!ret) {
chain = &xfrm_policy_inexact[dir];
hlist_for_each_entry(pol, entry, chain, bydst) {
if (xfrm_policy_match(pol, fl, type, family, dir)) {
xfrm_pol_hold(pol);
ret = pol;
break;
}
chain = &xfrm_policy_inexact[dir];
hlist_for_each_entry(pol, entry, chain, bydst) {
if (xfrm_policy_match(pol, fl, type, family, dir) &&
pol->priority < priority) {
ret = pol;
break;
}
}
if (ret)
xfrm_pol_hold(ret);
read_unlock_bh(&xfrm_policy_lock);

return ret;
Expand Down

0 comments on commit 6c79798

Please sign in to comment.