• Jozsef Kadlecsik's avatar
    netfilter: ipset: Consistent userspace testing with nomatch flag · 0f1799ba
    Jozsef Kadlecsik authored
    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: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
    0f1799ba
ip_set_hash_netiface.c 15.7 KB