diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-11-25 20:32:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 20:32:14 -0500 |
commit | 284fa7da300adcb700b44df2f64a536b434d4650 (patch) | |
tree | 382f31cff91d68085b03bd4df639fd7ad3c78051 /net/xfrm | |
parent | 5447c5e401c49aba0c36bb1066f2d25b152553b7 (diff) |
netns xfrm: state walking in netns
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_state.c | 6 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 0d974fc9dd6c..ea340bbbcc64 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1544,7 +1544,7 @@ unlock: | |||
1544 | } | 1544 | } |
1545 | EXPORT_SYMBOL(xfrm_alloc_spi); | 1545 | EXPORT_SYMBOL(xfrm_alloc_spi); |
1546 | 1546 | ||
1547 | int xfrm_state_walk(struct xfrm_state_walk *walk, | 1547 | int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, |
1548 | int (*func)(struct xfrm_state *, int, void*), | 1548 | int (*func)(struct xfrm_state *, int, void*), |
1549 | void *data) | 1549 | void *data) |
1550 | { | 1550 | { |
@@ -1557,10 +1557,10 @@ int xfrm_state_walk(struct xfrm_state_walk *walk, | |||
1557 | 1557 | ||
1558 | spin_lock_bh(&xfrm_state_lock); | 1558 | spin_lock_bh(&xfrm_state_lock); |
1559 | if (list_empty(&walk->all)) | 1559 | if (list_empty(&walk->all)) |
1560 | x = list_first_entry(&init_net.xfrm.state_all, struct xfrm_state_walk, all); | 1560 | x = list_first_entry(&net->xfrm.state_all, struct xfrm_state_walk, all); |
1561 | else | 1561 | else |
1562 | x = list_entry(&walk->all, struct xfrm_state_walk, all); | 1562 | x = list_entry(&walk->all, struct xfrm_state_walk, all); |
1563 | list_for_each_entry_from(x, &init_net.xfrm.state_all, all) { | 1563 | list_for_each_entry_from(x, &net->xfrm.state_all, all) { |
1564 | if (x->state == XFRM_STATE_DEAD) | 1564 | if (x->state == XFRM_STATE_DEAD) |
1565 | continue; | 1565 | continue; |
1566 | state = container_of(x, struct xfrm_state, km); | 1566 | state = container_of(x, struct xfrm_state, km); |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 3d577440b673..787b0ee65034 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -631,7 +631,7 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | |||
631 | xfrm_state_walk_init(walk, 0); | 631 | xfrm_state_walk_init(walk, 0); |
632 | } | 632 | } |
633 | 633 | ||
634 | (void) xfrm_state_walk(walk, dump_one_state, &info); | 634 | (void) xfrm_state_walk(&init_net, walk, dump_one_state, &info); |
635 | 635 | ||
636 | return skb->len; | 636 | return skb->len; |
637 | } | 637 | } |