From: James Haggerty Date: Mon, 10 Mar 2025 23:46:12 +0000 (+1100) Subject: interface: when interface properties change, reinitialise X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=632953a1582dceb3472ed459c03df1fbb5e0717b;p=project%2Fmdnsd.git interface: when interface properties change, reinitialise Without this, when the ip addresses on an interface changed it would no longer interact correctly with the interface. Addresses #20 Signed-off-by: Felix Fietkau --- diff --git a/interface.c b/interface.c index e2f0ce9..340878e 100644 --- a/interface.c +++ b/interface.c @@ -462,12 +462,16 @@ iface_update_cb(struct vlist_tree *tree, struct vlist_node *node_new, struct interface *if_new = container_of_safe(node_new, struct interface, node); if (if_old && if_new) { - if (!iface_equal(if_old, if_new)) + bool equal = iface_equal(if_old, if_new); + if (!equal) cache_cleanup(if_old); free(if_old->addrs.v4); if_old->addrs = if_new->addrs; if_old->ifindex = if_new->ifindex; free(if_new); + + if (!equal) + interface_start(if_old); return; }