summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 0c75be3323..3542994e65 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -623,7 +623,7 @@ struct route_map_list {
static struct route_map_list route_map_master = {NULL, NULL, NULL, NULL, NULL};
struct hash *route_map_master_hash = NULL;
-static unsigned int route_map_hash_key_make(void *p)
+static unsigned int route_map_hash_key_make(const void *p)
{
const struct route_map *map = p;
return string_hash_make(map->name);
@@ -673,7 +673,7 @@ struct route_map_dep {
/* Hashes maintaining dependency between various sublists used by route maps */
struct hash *route_map_dep_hash[ROUTE_MAP_DEP_MAX];
-static unsigned int route_map_dep_hash_make_key(void *p);
+static unsigned int route_map_dep_hash_make_key(const void *p);
static void route_map_clear_all_references(char *rmap_name);
static void route_map_rule_delete(struct route_map_rule_list *,
struct route_map_rule *);
@@ -906,6 +906,8 @@ static const char *route_map_type_str(enum route_map_type type)
return "";
break;
}
+
+ return "";
}
static int route_map_empty(struct route_map *map)
@@ -1287,7 +1289,6 @@ int route_map_add_match(struct route_map_index *index, const char *match_name,
struct route_map_rule *next;
struct route_map_rule_cmd *cmd;
void *compile;
- int replaced = 0;
/* First lookup rule for add match statement. */
cmd = route_map_lookup_match(match_name);
@@ -1317,7 +1318,6 @@ int route_map_add_match(struct route_map_index *index, const char *match_name,
}
route_map_rule_delete(&index->match_list, rule);
- replaced = 1;
}
}
@@ -1379,7 +1379,6 @@ int route_map_add_set(struct route_map_index *index, const char *set_name,
struct route_map_rule *next;
struct route_map_rule_cmd *cmd;
void *compile;
- int replaced = 0;
cmd = route_map_lookup_set(set_name);
if (cmd == NULL)
@@ -1398,10 +1397,8 @@ int route_map_add_set(struct route_map_index *index, const char *set_name,
route_map_index. */
for (rule = index->set_list.head; rule; rule = next) {
next = rule->next;
- if (rule->cmd == cmd) {
+ if (rule->cmd == cmd)
route_map_rule_delete(&index->set_list, rule);
- replaced = 1;
- }
}
/* Add new route map match rule. */
@@ -1709,7 +1706,7 @@ static void *route_map_name_hash_alloc(void *p)
return ((void *)XSTRDUP(MTYPE_ROUTE_MAP_NAME, (const char *)p));
}
-static unsigned int route_map_dep_hash_make_key(void *p)
+static unsigned int route_map_dep_hash_make_key(const void *p)
{
return (string_hash_make((char *)p));
}