- tagging of external routes?
-- when an identical route is received, don't trigger updates
-
-- configure: --enable-ipv6
- configure: IPv6 on glibc 2.0?
- Makefile: install target?
* Routing entry hooks (called only for rte's belonging to this protocol):
*
* rte_better Compare two rte's and decide which one is better (1=first, 0=second).
+ * rte_same Compare two rte's and decide whether they are identical (1=yes, 0=no).
* rte_insert Called whenever a rte is inserted to a routing table.
* rte_remove Called whenever a rte is removed from the routing table.
*/
int (*rte_better)(struct rte *, struct rte *);
+ int (*rte_same)(struct rte *, struct rte *);
void (*rte_insert)(struct network *, struct rte *);
void (*rte_remove)(struct network *, struct rte *);
sl_free(rte_slab, e);
}
+static int
+rte_same(rte *x, rte *y)
+{
+ return
+ x->attrs == y->attrs &&
+ x->flags == y->flags &&
+ x->pflags == y->pflags &&
+ x->pref == y->pref &&
+ (!x->attrs->proto->rte_same || x->attrs->proto->rte_same(x, y));
+}
+
static void
rte_recalculate(rtable *table, net *net, struct proto *p, rte *new, ea_list *tmpa)
{
{
if (old->attrs->proto == p)
{
+ if (rte_same(old, new))
+ {
+ /* No changes, ignore the new route */
+ rte_trace_in(D_ROUTES, p, new, "ignored");
+ rte_free_quick(new);
+ old->lastmod = now;
+ return;
+ }
*k = old->next;
break;
}