]> granicus.if.org Git - ipset/commitdiff
netfilter: ipset: Return bool values instead of int
authorSergey Popovich <popovich_sergei@mail.ua>
Mon, 17 Nov 2014 19:21:40 +0000 (21:21 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 20 Mar 2015 19:49:12 +0000 (20:49 +0100)
Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
kernel/net/netfilter/ipset/ip_set_hash_ip.c
kernel/net/netfilter/ipset/ip_set_hash_ipmark.c
kernel/net/netfilter/ipset/ip_set_hash_ipport.c
kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
kernel/net/netfilter/ipset/ip_set_hash_mac.c
kernel/net/netfilter/ipset/ip_set_hash_net.c
kernel/net/netfilter/ipset/ip_set_hash_netiface.c
kernel/net/netfilter/ipset/ip_set_hash_netport.c
kernel/net/netfilter/ipset/ip_set_hash_netportnet.c

index effa9467e58a969a652f318b4506b1a2a4b81752..91acf8a14683f84ce358d9de97084d92f0a3a7b1 100644 (file)
@@ -56,15 +56,15 @@ hash_ip4_data_equal(const struct hash_ip4_elem *e1,
        return e1->ip == e2->ip;
 }
 
-static inline bool
+static bool
 hash_ip4_data_list(struct sk_buff *skb, const struct hash_ip4_elem *e)
 {
        if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, e->ip))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -192,10 +192,10 @@ hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *e)
 {
        if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index b4dacb766c467d2429b510bde458627b237b8065..9ee63a60ca801b4a6a4617e5dc1de7692e3ae48a 100644 (file)
@@ -63,10 +63,10 @@ hash_ipmark4_data_list(struct sk_buff *skb,
        if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
            nla_put_net32(skb, IPSET_ATTR_MARK, htonl(data->mark)))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -187,10 +187,10 @@ hash_ipmark6_data_list(struct sk_buff *skb,
        if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
            nla_put_net32(skb, IPSET_ATTR_MARK, htonl(data->mark)))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index 941f90158776ce3ca8fd3d86cd2ac8883e07b988..1357a57dddcc07620476c837d3a5d7746d401d81 100644 (file)
@@ -69,10 +69,10 @@ hash_ipport4_data_list(struct sk_buff *skb,
            nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
            nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -225,10 +225,10 @@ hash_ipport6_data_list(struct sk_buff *skb,
            nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
            nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index fc52934d8bd79f46322ca1051392fa48d9204794..1154f90ab6f1a5d86fa64cfc64853c4d397ff14b 100644 (file)
@@ -70,10 +70,10 @@ hash_ipportip4_data_list(struct sk_buff *skb,
            nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
            nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -234,10 +234,10 @@ hash_ipportip6_data_list(struct sk_buff *skb,
            nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
            nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index b6223e3b30411365928e9e816d86ccf6b3a44219..b9d104199f4ed9f17e0ed0c09edf5f60fec85a47 100644 (file)
@@ -114,10 +114,10 @@ hash_ipportnet4_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -363,10 +363,10 @@ hash_ipportnet6_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index aa20c2092a04cc5ba7da22e5aa2e81732edd0ee7..f9020e7162f5fd1da082c8cc3644af2186e09481 100644 (file)
@@ -52,7 +52,12 @@ hash_mac4_data_equal(const struct hash_mac4_elem *e1,
 static inline bool
 hash_mac4_data_list(struct sk_buff *skb, const struct hash_mac4_elem *e)
 {
-       return nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN, e->ether);
+       if (nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN, e->ether))
+               goto nla_put_failure;
+       return false;
+
+nla_put_failure:
+       return true;
 }
 
 static inline void
index 01fe64a0637ae538bcf3af2f4e378ef03beb15c0..c08ca886ff3ad4394c56b840d84f73911fbb9700 100644 (file)
@@ -95,10 +95,10 @@ hash_net4_data_list(struct sk_buff *skb, const struct hash_net4_elem *data)
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -261,10 +261,10 @@ hash_net6_data_list(struct sk_buff *skb, const struct hash_net6_elem *data)
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index 29d42d00072a3c1ce29406b80a8c74705bee8b9d..5be5348bd6ce5c2338f74374eac5bd70e2879519 100644 (file)
@@ -116,10 +116,10 @@ hash_netiface4_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -327,10 +327,10 @@ hash_netiface6_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index 464122d557af1c10b6aaeb1ca097d6eb49841345..2ae64d7533f74a4b790b1c280b42255ed4da51cd 100644 (file)
@@ -110,10 +110,10 @@ hash_netport4_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -322,10 +322,10 @@ hash_netport6_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
index 3fe3afc8af29631fcb3e7b8b3989d78193bb2172..7dce7f9ec2ac5eae6362dddb14aeb8fba7da7f7a 100644 (file)
@@ -124,10 +124,10 @@ hash_netportnet4_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void
@@ -391,10 +391,10 @@ hash_netportnet6_data_list(struct sk_buff *skb,
            (flags &&
             nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
                goto nla_put_failure;
-       return 0;
+       return false;
 
 nla_put_failure:
-       return 1;
+       return true;
 }
 
 static inline void