diff options
Diffstat (limited to 'lib/data.c')
-rw-r--r-- | lib/data.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -166,7 +166,7 @@ do { \ * @data: data blob * @flags: the option flag to be ignored * - * Returns true if the option was not already ignored. + * Returns true if the option was already ignored. */ bool ipset_data_ignored(struct ipset_data *data, enum ipset_opt opt) @@ -181,6 +181,21 @@ ipset_data_ignored(struct ipset_data *data, enum ipset_opt opt) } /** + * ipset_data_test_ignored - test ignored bits in the data blob + * @data: data blob + * @flags: the option flag to be tested + * + * Returns true if the option is ignored. + */ +bool +ipset_data_test_ignored(struct ipset_data *data, enum ipset_opt opt) +{ + assert(data); + + return data->ignored & IPSET_FLAG(opt); +} + +/** * ipset_data_set - put data into the data blob * @data: data blob * @opt: the option kind of the data @@ -208,6 +223,7 @@ ipset_data_set(struct ipset_data *data, enum ipset_opt opt, const void *value) break; case IPSET_OPT_FAMILY: data->family = *(const uint8_t *) value; + data->ignored &= ~IPSET_FLAG(IPSET_OPT_FAMILY); D("family set to %u", data->family); break; /* CADT options */ |