summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-05-09 18:36:50 -0400
committerGitHub <noreply@github.com>2019-05-09 18:36:50 -0400
commit900193b0226ea20eddf56e9bfd2d7eeed3704357 (patch)
treedb5037ea1762fabf3e211e9b9a6378fe87031c57 /lib/routemap.c
parent58d9d6ac7ca29f80bb52ae4eec63073c6eb9b110 (diff)
parent6c3247bd2a937b136bca61eb0089a884b558dec3 (diff)
Merge pull request #4287 from NaveenThanikachalam/dup_config_processing
lib, bgpd: Disallow processing of duplicate config.
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 4898a8d0fa..e9c8d9c4cf 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1308,6 +1308,16 @@ int route_map_add_match(struct route_map_index *index, const char *match_name,
for (rule = index->match_list.head; rule; rule = next) {
next = rule->next;
if (rule->cmd == cmd) {
+ /* If the configured route-map match rule is exactly
+ * the same as the existing configuration then,
+ * ignore the duplicate configuration.
+ */
+ if (strcmp(match_arg, rule->rule_str) == 0) {
+ if (cmd->func_free)
+ (*cmd->func_free)(compile);
+ return RMAP_COMPILE_SUCCESS;
+ }
+
route_map_rule_delete(&index->match_list, rule);
replaced = 1;
}
@@ -2803,6 +2813,13 @@ DEFUN (rmap_call,
assert(index);
+ /* If "call" is invoked with the same route-map name as
+ * the one previously configured then, ignore the duplicate
+ * configuration.
+ */
+ if (index->nextrm && (strcmp(index->nextrm, rmap) == 0))
+ return CMD_SUCCESS;
+
if (index->nextrm) {
route_map_upd8_dependency(RMAP_EVENT_CALL_DELETED,
index->nextrm, index->map->name);