summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-14 01:35:20 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-11-14 01:35:20 +0100
commit1782514fb957d86c0e2510f2e76651345c5c9fb1 (patch)
treed4282946603ca67c78ee17ff03aa7cf890e577bd /isisd
parentMerge pull request #7474 from eololab/fix-crash-skiplist-debug (diff)
downloadfrr-1782514fb957d86c0e2510f2e76651345c5c9fb1.tar.xz
frr-1782514fb957d86c0e2510f2e76651345c5c9fb1.zip
*: Remove route_map_object_t from the system
The route_map_object_t was being used to track what protocol we were being called against. But each protocol was only ever calling itself. So we had a variable that was only ever being passed in from route_map_apply that had to be carried against and everyone was testing if that variable was for their own stack. Clean up this route_map_object_t from the entire system. We should speed some stuff up. Yes I know not a bunch but this will add up. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_redist.c3
-rw-r--r--isisd/isis_routemap.c34
2 files changed, 10 insertions, 27 deletions
diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c
index e6c7a734b..d699ffd2e 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;
}
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;
}