X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=utils.c;h=66c186580428405da587eb8c2dd01c4b49e5e7a3;hb=e5c8c87ce6e9423f1445020440e715ea9f9fc466;hp=ea409742f829bd720dd043eff822a11235506c91;hpb=29f2457a3d054893c8718fd511bb11ab1d8f5652;p=project%2Ffirewall3.git diff --git a/utils.c b/utils.c index ea40974..66c1865 100644 --- a/utils.c +++ b/utils.c @@ -557,9 +557,7 @@ write_ipset_uci(struct uci_context *ctx, struct fw3_ipset *s, list_for_each_entry(type, &s->datatypes, list) { - sprintf(buf, "%s_%s", type->dest ? "dst" : "src", - fw3_ipset_type_names[type->type]); - + sprintf(buf, "%s_%s", type->dir, fw3_ipset_type_names[type->type]); ptr.o = NULL; ptr.option = "match"; ptr.value = buf; @@ -656,6 +654,22 @@ fw3_free_object(void *obj, const void *opts) free(obj); } +void +fw3_free_list(struct list_head *head) +{ + struct list_head *entry, *tmp; + + if (!head) + return; + + list_for_each_safe(entry, tmp, head) + { + list_del(entry); + free(entry); + } + + free(head); +} bool fw3_hotplug(bool add, void *zone, void *device)