+ return;
+ }
+
+ if (!cf->propagate_routes)
+ return;
+
+ /*
+ * Some other route we want to send (or stop sending). Update the cache,
+ * with marking a removed one as dead or creating a new one as needed.
+ *
+ * And yes, we exclude the trigger route on purpose.
+ */
+
+ if (new)
+ {
+ /* Update */
+
+ ea = ea_find(new->attrs->eattrs, EA_RA_PREFERENCE);
+ uint preference = ea ? ea->u.data : RA_PREF_MEDIUM;
+ uint preference_set = !!ea;
+
+ ea = ea_find(new->attrs->eattrs, EA_RA_LIFETIME);
+ uint lifetime = ea ? ea->u.data : 0;
+ uint lifetime_set = !!ea;
+
+ if ((preference != RA_PREF_LOW) &&
+ (preference != RA_PREF_MEDIUM) &&
+ (preference != RA_PREF_HIGH))
+ {
+ log(L_WARN "%s: Invalid ra_preference value %u on route %N",
+ p->p.name, preference, n->n.addr);
+ preference = RA_PREF_MEDIUM;
+ preference_set = 1;
+ lifetime = 0;
+ lifetime_set = 1;
+ }
+
+ rt = fib_get(&p->routes, n->n.addr);
+
+ /* Ignore update if nothing changed */
+ if (rt->valid &&
+ (rt->preference == preference) &&
+ (rt->preference_set == preference_set) &&
+ (rt->lifetime == lifetime) &&
+ (rt->lifetime_set == lifetime_set))
+ return;
+
+ if (p->routes.entries == 18)
+ log(L_WARN "%s: More than 17 routes exported to RAdv", p->p.name);
+
+ rt->valid = 1;
+ rt->changed = current_time();
+ rt->preference = preference;
+ rt->preference_set = preference_set;
+ rt->lifetime = lifetime;
+ rt->lifetime_set = lifetime_set;
+ }
+ else
+ {
+ /* Withdraw */
+ rt = fib_find(&p->routes, n->n.addr);
+
+ if (!rt || !rt->valid)
+ return;
+
+ /* Invalidate the route */
+ rt->valid = 0;
+ rt->changed = current_time();
+
+ /* Invalidated route will be pruned eventually */
+ btime expires = rt->changed + cf->max_linger_time S;
+ p->prune_time = MIN(p->prune_time, expires);