{
struct isis_nexthop *nexthop;
- nexthop = nexthoplookup(isis->nexthops, family, ip, ifindex);
- if (nexthop) {
- nexthop->lock++;
- return nexthop;
- }
-
nexthop = XCALLOC(MTYPE_ISIS_NEXTHOP, sizeof(struct isis_nexthop));
nexthop->family = family;
nexthop->ifindex = ifindex;
nexthop->ip = *ip;
- listnode_add(isis->nexthops, nexthop);
- nexthop->lock++;
return nexthop;
}
static void isis_nexthop_delete(struct isis_nexthop *nexthop)
{
- nexthop->lock--;
- if (nexthop->lock == 0) {
- listnode_delete(isis->nexthops, nexthop);
- XFREE(MTYPE_ISIS_NEXTHOP, nexthop);
- }
-
- return;
+ XFREE(MTYPE_ISIS_NEXTHOP, nexthop);
}
static struct isis_nexthop *nexthoplookup(struct list *nexthops, int family,
isis->area_list = list_new();
isis->init_circ_list = list_new();
isis->uptime = time(NULL);
- isis->nexthops = list_new();
dyn_cache_init();
/*
* uncomment the next line for full debugs
uint32_t router_id; /* Router ID from zebra */
struct list *area_list; /* list of IS-IS areas */
struct list *init_circ_list;
- struct list *nexthops; /* IP next hops from this IS */
uint8_t max_area_addrs; /* maximumAreaAdresses */
struct area_addr *man_area_addrs; /* manualAreaAddresses */
uint32_t debugs; /* bitmap for debug */