diff options
-rw-r--r-- | nest/iface.c | 12 | ||||
-rw-r--r-- | nest/rt-attr.c | 2 | ||||
-rw-r--r-- | nest/rt-table.c | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/nest/iface.c b/nest/iface.c index 5342f12..3f21c43 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -130,7 +130,8 @@ neigh_if_up(struct iface *i) 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); } } @@ -144,7 +145,8 @@ neigh_if_down(struct iface *i) 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); @@ -241,6 +243,8 @@ if_changed(struct iface *i, struct iface *j) 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); @@ -250,7 +254,9 @@ if_notify_change(unsigned c, struct iface *old, struct iface *new) 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); diff --git a/nest/rt-attr.c b/nest/rt-attr.c index e667625..5f386a7 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -62,7 +62,7 @@ rta_same(rta *x, rta *y) 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 * diff --git a/nest/rt-table.c b/nest/rt-table.c index e61e9f2..85d42be 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -85,6 +85,8 @@ rte_get_temp(rta *a) 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) @@ -96,7 +98,9 @@ rte_better(rte *new, rte *old) /* 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 @@ -106,7 +110,8 @@ rte_announce(rte *new, rte *old) 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 |