]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
netfilter: ipset: Consistent userspace testing with nomatch flag
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 16 Sep 2013 18:04:53 +0000 (20:04 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 16 Sep 2013 18:35:55 +0000 (20:35 +0200)
commit0f1799ba1a5db4c48b72ac2da2dc70d8c190a73d
tree5b7c5e791c45eb6cc4c174dc27ac98eb2643cf86
parent55524c219aa803887d1c247853842a9566598cba
netfilter: ipset: Consistent userspace testing with nomatch flag

The "nomatch" commandline flag should invert the matching at testing,
similarly to the --return-nomatch flag of the "set" match of iptables.
Until now it worked with the elements with "nomatch" flag only. From
now on it works with elements without the flag too, i.e:

 # ipset n test hash:net
 # ipset a test 10.0.0.0/24 nomatch
 # ipset t test 10.0.0.1
 10.0.0.1 is NOT in set test.
 # ipset t test 10.0.0.1 nomatch
 10.0.0.1 is in set test.

 # ipset a test 192.168.0.0/24
 # ipset t test 192.168.0.1
 192.168.0.1 is in set test.
 # ipset t test 192.168.0.1 nomatch
 192.168.0.1 is NOT in set test.

 Before the patch the results were

 ...
 # ipset t test 192.168.0.1
 192.168.0.1 is in set test.
 # ipset t test 192.168.0.1 nomatch
 192.168.0.1 is in set test.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
include/linux/netfilter/ipset/ip_set.h
net/netfilter/ipset/ip_set_core.c
net/netfilter/ipset/ip_set_hash_ipportnet.c
net/netfilter/ipset/ip_set_hash_net.c
net/netfilter/ipset/ip_set_hash_netiface.c
net/netfilter/ipset/ip_set_hash_netport.c