#include "zebra/label_manager.h"
#include "zebra/zebra_errors.h"
#include "zebra/zapi_msg.h"
+#include "zebra/debug.h"
#define CONNECTION_DELAY 5
int count = 0;
int ret;
- zlog_debug("%s: Releasing chunks for client proto %s, instance %d",
- __func__, zebra_route_string(proto), instance);
+ if (IS_ZEBRA_DEBUG_PACKET)
+ zlog_debug("%s: Releasing chunks for client proto %s, instance %d",
+ __func__, zebra_route_string(proto), instance);
for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) {
if (lmc->proto == proto && lmc->instance == instance
}
}
- zlog_debug("%s: Released %d label chunks", __func__, count);
+ if (IS_ZEBRA_DEBUG_PACKET)
+ zlog_debug("%s: Released %d label chunks", __func__, count);
return count;
}
* included in the previous one */
for (node = first_node; node && (node != last_node);
node = next) {
+ struct label_manager_chunk *death;
+
next = listnextnode(node);
+ death = listgetdata(node);
list_delete_node(lbl_mgr.lc_list, node);
+ delete_label_chunk(death);
}
lmc = create_label_chunk(proto, instance, keep, base, end);
int ret = -1;
/* check that size matches */
- zlog_debug("Releasing label chunk: %u - %u", start, end);
+ if (IS_ZEBRA_DEBUG_PACKET)
+ zlog_debug("Releasing label chunk: %u - %u", start, end);
/* find chunk and disown */
for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) {
if (lmc->start != start)