summaryrefslogtreecommitdiff
path: root/nest/rt-table.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/rt-table.c
parent7f4a39886c128bfc2e39987180eb1482ee04d553 (diff)
Protocol hooks. All of them may be NULL.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index e61e9f20..85d42beb 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