Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122215
b: refs/heads/master
c: 3dd0b49
h: refs/heads/master
i:
  122213: 0b4f314
  122211: dfee6dd
  122207: 213a25e
v: v3
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Nov 26, 2008
1 parent 4a0ba32 commit 7a386b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: 99a66657b2f62ae8b2b1e6ffc6abed051e4561ca
refs/heads/master: 3dd0b4997a1d4f3a3666e400cc75b0279ce96849
19 changes: 8 additions & 11 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ static void prune_one_bundle(struct xfrm_policy *pol, int (*func)(struct dst_ent
write_unlock(&pol->lock);
}

static void xfrm_prune_bundles(int (*func)(struct dst_entry *))
static void xfrm_prune_bundles(struct net *net, int (*func)(struct dst_entry *))
{
struct dst_entry *gc_list = NULL;
int dir;
Expand All @@ -2150,11 +2150,11 @@ static void xfrm_prune_bundles(int (*func)(struct dst_entry *))
int i;

hlist_for_each_entry(pol, entry,
&init_net.xfrm.policy_inexact[dir], bydst)
&net->xfrm.policy_inexact[dir], bydst)
prune_one_bundle(pol, func, &gc_list);

table = init_net.xfrm.policy_bydst[dir].table;
for (i = init_net.xfrm.policy_bydst[dir].hmask; i >= 0; i--) {
table = net->xfrm.policy_bydst[dir].table;
for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) {
hlist_for_each_entry(pol, entry, table + i, bydst)
prune_one_bundle(pol, func, &gc_list);
}
Expand All @@ -2175,12 +2175,12 @@ static int unused_bundle(struct dst_entry *dst)

static void __xfrm_garbage_collect(void)
{
xfrm_prune_bundles(unused_bundle);
xfrm_prune_bundles(&init_net, unused_bundle);
}

static int xfrm_flush_bundles(void)
static int xfrm_flush_bundles(struct net *net)
{
xfrm_prune_bundles(stale_bundle);
xfrm_prune_bundles(net, stale_bundle);
return 0;
}

Expand Down Expand Up @@ -2366,12 +2366,9 @@ static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void
{
struct net_device *dev = ptr;

if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;

switch (event) {
case NETDEV_DOWN:
xfrm_flush_bundles();
xfrm_flush_bundles(dev_net(dev));
}
return NOTIFY_DONE;
}
Expand Down

0 comments on commit 7a386b8

Please sign in to comment.