diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-04-04 15:19:25 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-04-04 15:19:25 +0200 |
commit | 2f9f28b212a2bd4948c8ceaaec33ce0123632129 (patch) | |
tree | 8c9961f59a190ab05a568216d69f4809ab3041e2 /net/netfilter/ipset/ip_set_bitmap_ip.c | |
parent | 512d06b5b64fb422d90f199b1be188082729edf9 (diff) |
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_ip.c')
-rw-r--r-- | net/netfilter/ipset/ip_set_bitmap_ip.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/ipset/ip_set_bitmap_ip.c b/net/netfilter/ipset/ip_set_bitmap_ip.c index bca96990218d..a113ff066928 100644 --- a/net/netfilter/ipset/ip_set_bitmap_ip.c +++ b/net/netfilter/ipset/ip_set_bitmap_ip.c @@ -338,8 +338,7 @@ bitmap_ip_head(struct ip_set *set, struct sk_buff *skb) NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP_TO, htonl(map->last_ip)); if (map->netmask != 32) NLA_PUT_U8(skb, IPSET_ATTR_NETMASK, map->netmask); - 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)) |