aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2013-04-08 15:51:25 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2013-04-29 14:08:44 -0400
commit43c56e595bb81319230affd545392536c933317e (patch)
tree61db0ec532d858885e812432b41e42188adb6738 /include
parent37fe0660981d7a1577409226f77554c2c5123e27 (diff)
netfilter: ipset: Make possible to test elements marked with nomatch
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter/ipset/ip_set.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 7958e84a65af..970187187f5b 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -200,6 +200,14 @@ ip_set_eexist(int ret, u32 flags)
200 return ret == -IPSET_ERR_EXIST && (flags & IPSET_FLAG_EXIST); 200 return ret == -IPSET_ERR_EXIST && (flags & IPSET_FLAG_EXIST);
201} 201}
202 202
203/* Match elements marked with nomatch */
204static inline bool
205ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt)
206{
207 return adt == IPSET_TEST &&
208 ret == -ENOTEMPTY && ((flags >> 16) & IPSET_FLAG_NOMATCH);
209}
210
203/* Check the NLA_F_NET_BYTEORDER flag */ 211/* Check the NLA_F_NET_BYTEORDER flag */
204static inline bool 212static inline bool
205ip_set_attr_netorder(struct nlattr *tb[], int type) 213ip_set_attr_netorder(struct nlattr *tb[], int type)