/*
* firewall3 - 3rd OpenWrt UCI firewall implementation
*
- * Copyright (C) 2014 Jo-Philipp Wich <jow@openwrt.org>
+ * Copyright (C) 2014 Jo-Philipp Wich <jo@mein.io>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
blob_for_each_attr(rule, a, rem) {
const char *type = NULL;
+ const char *name = "ubus rule";
blobmsg_for_each_attr(opt, rule, orem)
if (!strcmp(blobmsg_name(opt), "type"))
type = blobmsg_get_string(opt);
+ else if (!strcmp(blobmsg_name(opt), "name"))
+ name = blobmsg_get_string(opt);
if (!type || strcmp(type, "nat"))
continue;
if (!(snat = alloc_snat(state)))
continue;
- if (!fw3_parse_blob_options(snat, fw3_snat_opts, rule))
+ if (!fw3_parse_blob_options(snat, fw3_snat_opts, rule, name))
{
- fprintf(stderr, "ubus section skipped due to invalid options\n");
+ fprintf(stderr, "%s skipped due to invalid options\n", name);
fw3_free_snat(snat);
continue;
}
if (snat->_src)
fw3_ipt_rule_append(r, "zone_%s_postrouting", snat->src.name);
else
- fw3_ipt_rule_append(r, "delegate_postrouting");
+ fw3_ipt_rule_append(r, "POSTROUTING");
}
static void