n->sibling = i->neigh;
i->neigh = n;
DBG("Waking up sticky neighbor %08x\n", _I(n->addr));
- n->proto->neigh_notify(n);
+ if (n->proto->neigh_notify)
+ n->proto->neigh_notify(n);
}
}
m = n->sibling;
DBG("Flushing neighbor %08x on %s\n", _I(n->addr), n->iface->name);
n->iface = NULL;
- n->proto->neigh_notify(n);
+ if (n->proto->neigh_notify)
+ n->proto->neigh_notify(n);
if (!(n->flags & NEF_STICKY))
{
rem_node(&n->n);
static void
if_notify_change(unsigned c, struct iface *old, struct iface *new)
{
+ struct proto *p;
+
debug("Interface change notification (%x) for %s\n", c, new->name);
if (old)
if_dump(old);
if (c & IF_CHANGE_UP)
neigh_if_up(new);
- /* FIXME: Notify protocols here */
+ WALK_LIST(p, proto_list)
+ if (p->if_notify)
+ p->if_notify(p, c, old, new);
if (c & IF_CHANGE_DOWN)
neigh_if_down(old);
ipa_equal(x->from, y->from) &&
x->iface == y->iface &&
ea_same(x->attrs, y->attrs) &&
- x->proto->rta_same(x, y));
+ (!x->proto->rta_same || x->proto->rta_same(x, y)));
}
static inline ea_list *
static int /* Actually better or at least as good as */
rte_better(rte *new, rte *old)
{
+ int (*better)(rte *, rte *);
+
if (!old)
return 1;
if (new->pref > old->pref)
/* FIXME!!! */
die("Different protocols, but identical preferences => oops");
}
- return new->attrs->proto->rte_better(new, old);
+ if (better = new->attrs->proto->rte_better)
+ return better(new, old);
+ return 0;
}
void
WALK_LIST(p, proto_list)
if (!new || new->attrs->proto != p)
- p->rt_notify(p, new, old);
+ if (p->rt_notify)
+ p->rt_notify(p, new, old);
}
static inline void