[LEDE-DEV,netifd,2/2] interface-ip: set prefix indicator flag when IPv6 prefix lifetime changes

Message ID 1489077180-12946-2-git-send-email-dedeckeh@gmail.com
State Accepted
Headers show

Commit Message

Hans Dedecker March 9, 2017, 4:33 p.m.
Trigger interface update event when IPv6 prefix lifetime changes by setting
the prefix indicator flag to inform external subsystems (eg hnetd) about IPv6
prefix lifetime changes.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
---
 interface-ip.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/interface-ip.c b/interface-ip.c
index 366f69a..9bf4234 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -1049,6 +1049,10 @@  interface_update_prefix(struct vlist_tree *tree,
 		list_for_each_entry(c, &prefix_new->assignments, head)
 			if ((iface = vlist_find(&interfaces, c->name, iface, node)))
 				interface_set_prefix_address(c, prefix_new, iface, true);
+
+		if (prefix_new->preferred_until != prefix_old->preferred_until ||
+				prefix_new->valid_until != prefix_old->valid_until)
+			ip->iface->updated |= IUF_PREFIX;
 	} else if (node_new) {
 		// Set null-route to avoid routing loops
 		system_add_route(NULL, &route);