aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipset/ip_set_bitmap_port.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-04-04 15:19:25 +0200
committerPatrick McHardy <kaber@trash.net>2011-04-04 15:19:25 +0200
commit2f9f28b212a2bd4948c8ceaaec33ce0123632129 (patch)
tree8c9961f59a190ab05a568216d69f4809ab3041e2 /net/netfilter/ipset/ip_set_bitmap_port.c
parentnetfilter: ipset: list:set timeout variant fixes (diff)
downloadlinux-dev-2f9f28b212a2bd4948c8ceaaec33ce0123632129.tar.xz
linux-dev-2f9f28b212a2bd4948c8ceaaec33ce0123632129.zip
netfilter: ipset: references are protected by rwlock instead of mutex
The timeout variant of the list:set type must reference the member sets. However, its garbage collector runs at timer interrupt so the mutex protection of the references is a no go. Therefore the reference protection is converted to rwlock. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/ipset/ip_set_bitmap_port.c')
-rw-r--r--net/netfilter/ipset/ip_set_bitmap_port.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/ipset/ip_set_bitmap_port.c b/net/netfilter/ipset/ip_set_bitmap_port.c
index 165f09b1a9cb..6b38eb8f6ed8 100644
--- a/net/netfilter/ipset/ip_set_bitmap_port.c
+++ b/net/netfilter/ipset/ip_set_bitmap_port.c
@@ -320,8 +320,7 @@ bitmap_port_head(struct ip_set *set, struct sk_buff *skb)
goto nla_put_failure;
NLA_PUT_NET16(skb, IPSET_ATTR_PORT, htons(map->first_port));
NLA_PUT_NET16(skb, IPSET_ATTR_PORT_TO, htons(map->last_port));
- NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES,
- htonl(atomic_read(&set->ref) - 1));
+ NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE,
htonl(sizeof(*map) + map->memsize));
if (with_timeout(map->timeout))