From 16c5b6c9bcb71bb67a6ab15bb458bf9ab5a8fe7e Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 27 Feb 2019 11:10:29 +0100 Subject: 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 --- src/ubus.c | 6 +++--- 1 file 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; } } -- cgit v1.2.3