From 04925e9040330afc92f8001e6a19ae2146e36782 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 7 Dec 1998 21:59:15 +0000 Subject: Minor rte/rta interface changes: o rte can now contain a pointer to both cached and uncached rta. Protocols which don't need their own attribute caching can now just fill-in a rta, link it to rte without any calls to attribute cache and call rte_update() which will replace rte->attrs by a cached copy. o In order to support this, one of previously pad bytes in struct rta now holds new attribute flags (RTAF_CACHED). If you call rte_update() with uncached rta, you _must_ clear these flags. In other cases rta_lookup() sets it appropriately. o Added rte_free() which is useful when you construct a rte and then the circumstances change and you decide not to use it for an update. (Needed for temporary rte's in kernel syncer...) --- nest/rt-attr.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nest/rt-attr.c') diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 9f7fd2b8..afce7f81 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -116,6 +116,7 @@ rta_lookup(rta *o) if (rta_same(r, o)) return rta_clone(r); r = rta_copy(o); + r->aflags = RTAF_CACHED; r->next = first_rta; first_rta = r; return r; @@ -144,6 +145,8 @@ rta_dump(rta *a) debug(" EXT"); if (a->flags & RTF_TAGGED) debug(" TAG"); + if (!(a->aflags & RTAF_CACHED)) + debug(" !CACHED"); debug(" <-%I", a->from); if (a->dest == RTD_ROUTER) debug(" ->%I", a->gw); -- cgit v1.2.3