summaryrefslogtreecommitdiff
path: root/nest/iface.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-06-03 08:40:10 +0000
committerMartin Mares <mj@ucw.cz>1998-06-03 08:40:10 +0000
commitd9f330c5ffe03c05b7e6541a06adac657f24407b (patch)
tree854204008b0e425669e9b1fbbd71138cdc82d0d0 /nest/iface.c
parent7f4a39886c128bfc2e39987180eb1482ee04d553 (diff)
Protocol hooks. All of them may be NULL.
Diffstat (limited to 'nest/iface.c')
-rw-r--r--nest/iface.c12
1 files changed, 9 insertions, 3 deletions
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);