projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf6e007
)
netfilter: xt_connlimit: use rb_entry()
author
Geliang Tang
<
[email protected]
>
Tue, 20 Dec 2016 14:02:13 +0000
(22:02 +0800)
committer
Pablo Neira Ayuso
<
[email protected]
>
Thu, 5 Jan 2017 12:27:02 +0000
(13:27 +0100)
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.
Signed-off-by: Geliang Tang <
[email protected]
>
Signed-off-by: Pablo Neira Ayuso <
[email protected]
>
net/netfilter/xt_connlimit.c
patch
|
blob
|
history
diff --git
a/net/netfilter/xt_connlimit.c
b/net/netfilter/xt_connlimit.c
index 2aff2b7c4689c897be7c0250d5c514e5ee8014d5..660b61dbd77614259ff1f4c1639b4bba500d5fbc 100644
(file)
--- 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);