Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15235
b: refs/heads/master
c: 399c180
h: refs/heads/master
i:
  15233: c004017
  15231: 2b27ce5
v: v3
  • Loading branch information
David S. Miller committed Dec 19, 2005
1 parent 031840a commit 283dde2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 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: 9e999993c71e1506378d26d81f842277aff8a250
refs/heads/master: 399c180ac5f0cb66ef9479358e0b8b6bafcbeafe
1 change: 1 addition & 0 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
extern void xfrm_policy_flush(void);
extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
extern int xfrm_flush_bundles(void);
extern void xfrm_flush_all_bundles(void);
extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family);
extern void xfrm_init_pmtu(struct dst_entry *dst);

Expand Down
19 changes: 14 additions & 5 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,13 +1014,12 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
}
EXPORT_SYMBOL(__xfrm_route_forward);

/* Optimize later using cookies and generation ids. */

static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)
{
if (!stale_bundle(dst))
return dst;

/* If it is marked obsolete, which is how we even get here,
* then we have purged it from the policy bundle list and we
* did that for a good reason.
*/
return NULL;
}

Expand Down Expand Up @@ -1104,6 +1103,16 @@ int xfrm_flush_bundles(void)
return 0;
}

static int always_true(struct dst_entry *dst)
{
return 1;
}

void xfrm_flush_all_bundles(void)
{
xfrm_prune_bundles(always_true);
}

void xfrm_init_pmtu(struct dst_entry *dst)
{
do {
Expand Down
5 changes: 5 additions & 0 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ void xfrm_state_insert(struct xfrm_state *x)
spin_lock_bh(&xfrm_state_lock);
__xfrm_state_insert(x);
spin_unlock_bh(&xfrm_state_lock);

xfrm_flush_all_bundles();
}
EXPORT_SYMBOL(xfrm_state_insert);

Expand Down Expand Up @@ -478,6 +480,9 @@ int xfrm_state_add(struct xfrm_state *x)
spin_unlock_bh(&xfrm_state_lock);
xfrm_state_put_afinfo(afinfo);

if (!err)
xfrm_flush_all_bundles();

if (x1) {
xfrm_state_delete(x1);
xfrm_state_put(x1);
Expand Down

0 comments on commit 283dde2

Please sign in to comment.