summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2019-02-27 11:10:29 +0100
committerHans Dedecker <dedeckeh@gmail.com>2019-02-27 11:47:12 +0100
commit16c5b6c9bcb71bb67a6ab15bb458bf9ab5a8fe7e (patch)
tree335fbeb00de107d1fde248a2e2e8d173168068ab /src
parent9e9389c9c6ebd29d61fd35c563c365195d263848 (diff)
ubus: always trigger an update if interface is not found
Commit 9f25dd8af76dc30e54ddcbb4a284058e598951d5 changed the logic of handle_update by only triggering an update if the interface is found in the interface list and is not set as to be ignored. However this breaks the behavior of loading the dhcp config for interfaces which were previously not yet known by netifd and as result were not yet created in the interface list. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/ubus.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ubus.c b/src/ubus.c
index b263da6..b2e48cf 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -245,15 +245,15 @@ static int handle_update(_unused struct ubus_context *ctx, _unused struct ubus_o
{
struct blob_attr *tb[IFACE_ATTR_MAX];
struct interface *c;
- bool update = false;
+ bool update = true;
blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb, blob_data(msg), blob_len(msg));
const char *interface = (tb[IFACE_ATTR_INTERFACE]) ?
blobmsg_get_string(tb[IFACE_ATTR_INTERFACE]) : "";
avl_for_each_element(&interfaces, c, avl) {
- if (!strcmp(interface, c->name) && !c->ignore) {
- update = true;
+ if (!strcmp(interface, c->name) && c->ignore) {
+ update = false;
break;
}
}