diff options
| author | James Haggerty | 2025-03-10 23:46:12 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2025-05-28 22:24:55 +0000 |
| commit | 632953a1582dceb3472ed459c03df1fbb5e0717b (patch) | |
| tree | 95385f0024c09a15ad7326ba8961d3e8dbf2f134 | |
| parent | ce508467a533424f97d1c3f9997e19bb1a1900fb (diff) | |
| download | mdnsd-632953a1582dceb3472ed459c03df1fbb5e0717b.tar.gz | |
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 <nbd@nbd.name>
| -rw-r--r-- | interface.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |