netns xfrm: state walking in netns
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5447c5e401
commit
284fa7da30
@@ -1544,7 +1544,7 @@ unlock:
|
||||
}
|
||||
EXPORT_SYMBOL(xfrm_alloc_spi);
|
||||
|
||||
int xfrm_state_walk(struct xfrm_state_walk *walk,
|
||||
int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk,
|
||||
int (*func)(struct xfrm_state *, int, void*),
|
||||
void *data)
|
||||
{
|
||||
@@ -1557,10 +1557,10 @@ int xfrm_state_walk(struct xfrm_state_walk *walk,
|
||||
|
||||
spin_lock_bh(&xfrm_state_lock);
|
||||
if (list_empty(&walk->all))
|
||||
x = list_first_entry(&init_net.xfrm.state_all, struct xfrm_state_walk, all);
|
||||
x = list_first_entry(&net->xfrm.state_all, struct xfrm_state_walk, all);
|
||||
else
|
||||
x = list_entry(&walk->all, struct xfrm_state_walk, all);
|
||||
list_for_each_entry_from(x, &init_net.xfrm.state_all, all) {
|
||||
list_for_each_entry_from(x, &net->xfrm.state_all, all) {
|
||||
if (x->state == XFRM_STATE_DEAD)
|
||||
continue;
|
||||
state = container_of(x, struct xfrm_state, km);
|
||||
|
Reference in New Issue
Block a user