Browse Source

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>
Hans Dedecker 5 years ago
parent
commit
16c5b6c9bc
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/ubus.c

+ 3 - 3
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;
 		}
 	}