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/rt-table.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nest/rt-table.c') 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 -- cgit v1.2.3