summaryrefslogtreecommitdiffstats
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-08-27 13:45:02 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-09-03 14:19:22 +0200
commite5b4b49e804b0e89ad2dfad2c13b36274538e08a (patch)
treeac55a6a1a0f7aa6b1969b3707fb76067337e5825 /lib/routemap.c
parentMerge pull request #4917 from manuhalo/fix_isis_circuit_del (diff)
downloadfrr-e5b4b49e804b0e89ad2dfad2c13b36274538e08a.tar.xz
frr-e5b4b49e804b0e89ad2dfad2c13b36274538e08a.zip
lib: Cleanup return codes to use enum values
A couple functions in routemap.c were returning 0/1 that were being mapped into the appropriate enum values on the calling functions to check return values. This matches the return values to the actual enum for future readability. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--lib/routemap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index eca02e836..c57415303 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1472,7 +1472,7 @@ int route_map_delete_match(struct route_map_index *index,
cmd = route_map_lookup_match(match_name);
if (cmd == NULL)
- return 1;
+ return RMAP_RULE_MISSING;
for (rule = index->match_list.head; rule; rule = rule->next)
if (rule->cmd == cmd && (rulecmp(rule->rule_str, match_arg) == 0
@@ -1485,10 +1485,10 @@ int route_map_delete_match(struct route_map_index *index,
index->map->name,
RMAP_EVENT_CALL_ADDED);
}
- return 0;
+ return RMAP_COMPILE_SUCCESS;
}
/* Can't find matched rule. */
- return 1;
+ return RMAP_RULE_MISSING;
}
/* Add route-map set statement to the route map. */
@@ -1551,7 +1551,7 @@ int route_map_delete_set(struct route_map_index *index, const char *set_name,
cmd = route_map_lookup_set(set_name);
if (cmd == NULL)
- return 1;
+ return RMAP_RULE_MISSING;
for (rule = index->set_list.head; rule; rule = rule->next)
if ((rule->cmd == cmd) && (rulecmp(rule->rule_str, set_arg) == 0
@@ -1564,10 +1564,10 @@ int route_map_delete_set(struct route_map_index *index, const char *set_name,
index->map->name,
RMAP_EVENT_CALL_ADDED);
}
- return 0;
+ return RMAP_COMPILE_SUCCESS;
}
/* Can't find matched rule. */
- return 1;
+ return RMAP_RULE_MISSING;
}
static enum route_map_cmd_result_t