From d9f330c5ffe03c05b7e6541a06adac657f24407b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 3 Jun 1998 08:40:10 +0000 Subject: Protocol hooks. All of them may be NULL. --- nest/iface.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'nest/iface.c') diff --git a/nest/iface.c b/nest/iface.c index 5342f120..3f21c435 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); -- cgit v1.2.3