diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-13 14:39:59 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-14 10:40:16 +0200 |
commit | 96f51428c43de20723630f0d756a7a9a42cbd974 (patch) | |
tree | e091eedd03dafcb68da9fb00fc2cf4db00b50483 /net/netfilter/ipset/ip_set_bitmap_ip.c | |
parent | b57b2d1fa53fe8563bdfc66a33b844463b9af285 (diff) | |
download | op-kernel-dev-96f51428c43de20723630f0d756a7a9a42cbd974.zip op-kernel-dev-96f51428c43de20723630f0d756a7a9a42cbd974.tar.gz |
netfilter: ipset: Introduce RCU locking in bitmap:* types
There's nothing much required because the bitmap types use atomic
bit operations. However the logic of adding elements slightly changed:
first the MAC address updated (which is not atomic), then the element
activated (added). The extensions may call kfree_rcu() therefore we
call rcu_barrier() at module removal.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
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, 2 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_bitmap_ip.c b/net/netfilter/ipset/ip_set_bitmap_ip.c index 7af99c3..b8ce474 100644 --- a/net/netfilter/ipset/ip_set_bitmap_ip.c +++ b/net/netfilter/ipset/ip_set_bitmap_ip.c @@ -81,7 +81,7 @@ static inline int bitmap_ip_do_add(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map, u32 flags, size_t dsize) { - return !!test_and_set_bit(e->id, map->members); + return !!test_bit(e->id, map->members); } static inline int @@ -376,6 +376,7 @@ bitmap_ip_init(void) static void __exit bitmap_ip_fini(void) { + rcu_barrier(); ip_set_type_unregister(&bitmap_ip_type); } |