Skip to content

Commit

Permalink
netlabel: correctly list all the static label mappings
Browse files Browse the repository at this point in the history
When we have a large number of static label mappings that spill across
the netlink message boundary we fail to properly save our state in the
netlink_callback struct which causes us to repeat the same listings.
This patch fixes this problem by saving the state correctly between
calls to the NetLabel static label netlink "dumpit" routines.

Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paul Moore authored and David S. Miller committed Mar 7, 2013
1 parent 260055b commit 0c1233a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/netlabel/netlabel_unlabeled.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,10 +1250,10 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,

unlabel_staticlist_return:
rcu_read_unlock();
cb->args[0] = skip_bkt;
cb->args[1] = skip_chain;
cb->args[2] = skip_addr4;
cb->args[3] = skip_addr6;
cb->args[0] = iter_bkt;
cb->args[1] = iter_chain;
cb->args[2] = iter_addr4;
cb->args[3] = iter_addr6;
return skb->len;
}

Expand Down Expand Up @@ -1320,8 +1320,8 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,

unlabel_staticlistdef_return:
rcu_read_unlock();
cb->args[0] = skip_addr4;
cb->args[1] = skip_addr6;
cb->args[0] = iter_addr4;
cb->args[1] = iter_addr6;
return skb->len;
}

Expand Down

0 comments on commit 0c1233a

Please sign in to comment.