From 5992b25ebee1ef68a6f0c9aaa9c67f9f7e6d74e9 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Jul 2010 01:04:21 +0100 Subject: Introduce "rs-in" route-map All peers may be configured with an "rs-in" route-map, whether they are rsclients, or not. All routes from a given peer are passed through the "rs-in" route-map before being considered for inclusion in any rsclients RIBs. Routes pass through the "rs-in" route-map once, irrespective of the number of rsclients. An "rs-in" route-map is intended to be used to ensure that routes from a given peer are kosher, before being passed to rsclients. The "in" route-map and filters may do the same, but for the main RIB. Any route-selection type actions that the "in" route-map may do for the main RIB will probably be done in the "import" route-map for an rsclient RIB. Also: * make zfree() work for NULL items, in lib/memory.c * fix clear ip bgp .... so works when pEstablished Version change to ex03. --- lib/memory.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/memory.c') diff --git a/lib/memory.c b/lib/memory.c index 2e295566..c13404d2 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -203,18 +203,21 @@ zrealloc (enum MTYPE mtype, void *ptr, size_t size MEMORY_TRACKER_NAME) void zfree (enum MTYPE mtype, void *ptr) { - LOCK ; + if (ptr != NULL) + { + LOCK ; - assert(mstat.mt[mtype].alloc > 0) ; + assert(mstat.mt[mtype].alloc > 0) ; - mstat.mt[mtype].alloc--; + mstat.mt[mtype].alloc--; #ifdef MEMORY_TRACKER - mem_md_free(mtype, ptr) ; + mem_md_free(mtype, ptr) ; #endif - free (ptr); + free (ptr); - UNLOCK ; + UNLOCK ; + } ; } ; /*------------------------------------------------------------------------------ -- cgit v1.2.3