diff options
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_redist.c | 16 | ||||
-rw-r--r-- | isisd/isis_redist.h | 1 | ||||
-rw-r--r-- | isisd/isis_routemap.c | 34 | ||||
-rw-r--r-- | isisd/isis_spf.c | 5 | ||||
-rw-r--r-- | isisd/isis_spf.h | 1 | ||||
-rw-r--r-- | isisd/isisd.c | 8 |
6 files changed, 38 insertions, 27 deletions
diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index e6c7a734b..240be27cf 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -167,8 +167,7 @@ static void isis_redist_update_ext_reach(struct isis_area *area, int level, area_info.metric = redist->metric; if (redist->map_name) { - map_ret = - route_map_apply(redist->map, p, RMAP_ISIS, &area_info); + map_ret = route_map_apply(redist->map, p, &area_info); if (map_ret == RMAP_DENYMATCH) area_info.distance = 255; } @@ -380,6 +379,19 @@ static void isis_redist_update_zebra_subscriptions(struct isis *isis) } } +void isis_redist_free(struct isis *isis) +{ + int i; + + for (i = 0; i < REDIST_PROTOCOL_COUNT; i++) { + if (!isis->ext_info[i]) + continue; + + route_table_finish(isis->ext_info[i]); + isis->ext_info[i] = NULL; + } +} + void isis_redist_set(struct isis_area *area, int level, int family, int type, uint32_t metric, const char *routemap, int originate_type) { diff --git a/isisd/isis_redist.h b/isisd/isis_redist.h index 0d2dc6a80..afce92224 100644 --- a/isisd/isis_redist.h +++ b/isisd/isis_redist.h @@ -62,4 +62,5 @@ void isis_redist_set(struct isis_area *area, int level, int family, int type, uint32_t metric, const char *routemap, int originate_type); void isis_redist_unset(struct isis_area *area, int level, int family, int type); +void isis_redist_free(struct isis *isis); #endif diff --git a/isisd/isis_routemap.c b/isisd/isis_routemap.c index 902528e1b..db0f2fd8b 100644 --- a/isisd/isis_routemap.c +++ b/isisd/isis_routemap.c @@ -49,14 +49,10 @@ #include "isis_routemap.h" static enum route_map_cmd_result_t -route_match_ip_address(void *rule, const struct prefix *prefix, - route_map_object_t type, void *object) +route_match_ip_address(void *rule, const struct prefix *prefix, void *object) { struct access_list *alist; - if (type != RMAP_ISIS) - return RMAP_NOMATCH; - alist = access_list_lookup(AFI_IP, (char *)rule); if (access_list_apply(alist, prefix) != FILTER_DENY) return RMAP_MATCH; @@ -85,13 +81,10 @@ static const struct route_map_rule_cmd route_match_ip_address_cmd = { static enum route_map_cmd_result_t route_match_ip_address_prefix_list(void *rule, const struct prefix *prefix, - route_map_object_t type, void *object) + void *object) { struct prefix_list *plist; - if (type != RMAP_ISIS) - return RMAP_NOMATCH; - plist = prefix_list_lookup(AFI_IP, (char *)rule); if (prefix_list_apply(plist, prefix) != PREFIX_DENY) return RMAP_MATCH; @@ -120,14 +113,10 @@ static const struct route_map_rule_cmd /* ------------------------------------------------------------*/ static enum route_map_cmd_result_t -route_match_ipv6_address(void *rule, const struct prefix *prefix, - route_map_object_t type, void *object) +route_match_ipv6_address(void *rule, const struct prefix *prefix, void *object) { struct access_list *alist; - if (type != RMAP_ISIS) - return RMAP_NOMATCH; - alist = access_list_lookup(AFI_IP6, (char *)rule); if (access_list_apply(alist, prefix) != FILTER_DENY) return RMAP_MATCH; @@ -156,13 +145,10 @@ static const struct route_map_rule_cmd route_match_ipv6_address_cmd = { static enum route_map_cmd_result_t route_match_ipv6_address_prefix_list(void *rule, const struct prefix *prefix, - route_map_object_t type, void *object) + void *object) { struct prefix_list *plist; - if (type != RMAP_ISIS) - return RMAP_NOMATCH; - plist = prefix_list_lookup(AFI_IP6, (char *)rule); if (prefix_list_apply(plist, prefix) != PREFIX_DENY) return RMAP_MATCH; @@ -191,18 +177,16 @@ static const struct route_map_rule_cmd /* ------------------------------------------------------------*/ static enum route_map_cmd_result_t -route_set_metric(void *rule, const struct prefix *prefix, - route_map_object_t type, void *object) +route_set_metric(void *rule, const struct prefix *prefix, void *object) { uint32_t *metric; struct isis_ext_info *info; - if (type == RMAP_ISIS) { - metric = rule; - info = object; + metric = rule; + info = object; + + info->metric = *metric; - info->metric = *metric; - } return RMAP_OKAY; } diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 5480a1b33..19cacde4f 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1727,6 +1727,11 @@ static struct isis_spf_run *isis_run_spf_arg(struct isis_area *area, int level) return run; } +void isis_spf_timer_free(void *run) +{ + XFREE(MTYPE_ISIS_SPF_RUN, run); +} + int _isis_spf_schedule(struct isis_area *area, int level, const char *func, const char *file, int line) { diff --git a/isisd/isis_spf.h b/isisd/isis_spf.h index a9a14fc75..ad15d3e3c 100644 --- a/isisd/isis_spf.h +++ b/isisd/isis_spf.h @@ -78,4 +78,5 @@ struct isis_spftree *isis_run_hopcount_spf(struct isis_area *area, uint8_t *sysid, struct isis_spftree *spftree); +void isis_spf_timer_free(void *run); #endif /* _ZEBRA_ISIS_SPF_H */ diff --git a/isisd/isisd.c b/isisd/isisd.c index 057ede0e3..950cdc281 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -442,7 +442,11 @@ void isis_area_destroy(struct isis_area *area) spftree_area_del(area); + if (area->spf_timer[0]) + isis_spf_timer_free(THREAD_ARG(area->spf_timer[0])); thread_cancel(&area->spf_timer[0]); + if (area->spf_timer[1]) + isis_spf_timer_free(THREAD_ARG(area->spf_timer[1])); thread_cancel(&area->spf_timer[1]); spf_backoff_free(area->spf_delay_ietf[0]); @@ -583,6 +587,7 @@ void isis_finish(struct isis *isis) isis_vrf_unlink(isis, vrf); } + isis_redist_free(isis); list_delete(&isis->area_list); list_delete(&isis->init_circ_list); XFREE(MTYPE_ISIS, isis); @@ -2375,6 +2380,9 @@ static void area_resign_level(struct isis_area *area, int level) } } + if (area->spf_timer[level - 1]) + isis_spf_timer_free(THREAD_ARG(area->spf_timer[level - 1])); + thread_cancel(&area->spf_timer[level - 1]); sched_debug( |