diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-17 21:01:56 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-17 21:01:56 -0500 |
| commit | b58ed1f8a89ea32c2380bf79057e5333109d72d4 (patch) | |
| tree | a9ead45b8895edce92ab69621a52816b45725e36 /lib/routemap.c | |
| parent | 01cb1466423363a2f8b42246464feb3858df1c9f (diff) | |
| parent | 5551c072e187c76c3d6a885cd043d6db811bab23 (diff) | |
Merge remote-tracking branch 'origin/master' into pim_lib_work2
Diffstat (limited to 'lib/routemap.c')
| -rw-r--r-- | lib/routemap.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 5f2b2c0dfb..74bae1fd76 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -989,9 +989,11 @@ vty_show_route_map_entry (struct vty *vty, struct route_map *map) /* Print the name of the protocol */ if (zlog_default) + { vty_out (vty, "%s", zlog_proto_names[zlog_default->protocol]); - if (zlog_default->instance) - vty_out (vty, " %d", zlog_default->instance); + if (zlog_default->instance) + vty_out (vty, " %d", zlog_default->instance); + } vty_out (vty, ":%s", VTY_NEWLINE); for (index = map->head; index; index = index->next) @@ -2766,17 +2768,16 @@ DEFUN (rmap_call, struct route_map_index *index = VTY_GET_CONTEXT (route_map_index); const char *rmap = argv[idx_word]->arg; - if (index) + assert(index); + + if (index->nextrm) { - if (index->nextrm) - { - route_map_upd8_dependency (RMAP_EVENT_CALL_DELETED, - index->nextrm, - index->map->name); - XFREE (MTYPE_ROUTE_MAP_NAME, index->nextrm); - } - index->nextrm = XSTRDUP (MTYPE_ROUTE_MAP_NAME, rmap); + route_map_upd8_dependency (RMAP_EVENT_CALL_DELETED, + index->nextrm, + index->map->name); + XFREE (MTYPE_ROUTE_MAP_NAME, index->nextrm); } + index->nextrm = XSTRDUP (MTYPE_ROUTE_MAP_NAME, rmap); /* Execute event hook. */ route_map_upd8_dependency (RMAP_EVENT_CALL_ADDED, @@ -2940,9 +2941,13 @@ route_map_finish (void) } for (i = 1; i < ROUTE_MAP_DEP_MAX; i++) - hash_free(route_map_dep_hash[i]); + { + hash_free(route_map_dep_hash[i]); + route_map_dep_hash[i] = NULL; + } hash_free (route_map_master_hash); + route_map_master_hash = NULL; } /* Initialization of route map vector. */ |
