ubus: fix interface name and proto lookup
authorHans Dedecker <dedeckeh@gmail.com>
Thu, 13 Apr 2017 13:49:04 +0000 (15:49 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 13 Apr 2017 13:52:01 +0000 (15:52 +0200)
Lookup of iface_name and iface_proto in the json data were switched
in fw3_ubus_rules

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
ubus.c

diff --git a/ubus.c b/ubus.c
index e5326f9b7268cfa9f1f4ebd0808d4eee4ff84b52..f353d015fefc4bb54322752a391692eb3ba255a2 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -259,9 +259,9 @@ fw3_ubus_rules(struct blob_buf *b)
                        if (!strcmp(blobmsg_name(cur), "l3_device"))
                                l3_device = blobmsg_get_string(cur);
                        else if (!strcmp(blobmsg_name(cur), "interface"))
-                               iface_proto = blobmsg_get_string(cur);
-                       else if (!strcmp(blobmsg_name(cur), "proto"))
                                iface_name = blobmsg_get_string(cur);
+                       else if (!strcmp(blobmsg_name(cur), "proto"))
+                               iface_proto = blobmsg_get_string(cur);
                        else if (!strcmp(blobmsg_name(cur), "data"))
                                data = cur;
                }