diff options
author | Geliang Tang <geliangtang@gmail.com> | 2016-12-20 22:02:13 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-01-05 13:27:02 +0100 |
commit | 4cc4b72c136a45aeccd86f66b0859b148b47d881 (patch) | |
tree | f2169a370c489193120c244d5ae7602ead703979 | |
parent | cf6e007eef83476c5d541453d84e08b07befe124 (diff) | |
download | op-kernel-dev-4cc4b72c136a45aeccd86f66b0859b148b47d881.zip op-kernel-dev-4cc4b72c136a45aeccd86f66b0859b148b47d881.tar.gz |
netfilter: xt_connlimit: use rb_entry()
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/xt_connlimit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c index 2aff2b7..660b61d 100644 --- a/net/netfilter/xt_connlimit.c +++ b/net/netfilter/xt_connlimit.c @@ -218,7 +218,7 @@ count_tree(struct net *net, struct rb_root *root, int diff; bool addit; - rbconn = container_of(*rbnode, struct xt_connlimit_rb, node); + rbconn = rb_entry(*rbnode, struct xt_connlimit_rb, node); parent = *rbnode; diff = same_source_net(addr, mask, &rbconn->addr, family); @@ -398,7 +398,7 @@ static void destroy_tree(struct rb_root *r) struct rb_node *node; while ((node = rb_first(r)) != NULL) { - rbconn = container_of(node, struct xt_connlimit_rb, node); + rbconn = rb_entry(node, struct xt_connlimit_rb, node); rb_erase(node, r); |