X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=ubus.c;h=9e034c8b8745a0240e2320266f4f69046bf5cae8;hb=e92392db91f6eb50288f33ccf63475aa7b9babdd;hp=ef2c53027dfb88f0b941a965b9321695ad02f84b;hpb=dba19a8f14cefdede3cc7d0f8322fdb9a2c44d50;p=project%2Ffirewall3.git diff --git a/ubus.c b/ubus.c index ef2c530..9e034c8 100644 --- a/ubus.c +++ b/ubus.c @@ -281,10 +281,12 @@ fw3_ubus_rules(struct blob_buf *b) snprintf(comment, sizeof(comment), "ubus:%s[%s] rule %d", iface_name, iface_proto, n++); - blobmsg_for_each_attr(ropt, rule, orem) - if (strcmp(blobmsg_name(ropt), "name") && - strcmp(blobmsg_name(ropt), "device")) + blobmsg_for_each_attr(ropt, rule, orem) { + if (!strcmp(blobmsg_name(ropt), "device")) + l3_device = blobmsg_get_string(ropt); + else if (strcmp(blobmsg_name(ropt), "name")) blobmsg_add_blob(b, ropt); + } blobmsg_add_string(b, "name", comment); blobmsg_add_string(b, "device", l3_device);