+static bool
+ipset_loaded(struct list_head *statefile, const char *name)
+{
+ struct fw3_statefile_entry *e;
+ int mask = (1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6);
+
+ if (!statefile)
+ return false;
+
+ list_for_each_entry(e, statefile, list)
+ {
+ if (e->type != FW3_TYPE_IPSET)
+ continue;
+
+ if (!strcmp(e->name, name) && (e->flags[0] & mask))
+ return true;
+ }
+
+ return false;
+}
+