summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-12-20 17:18:14 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-04 18:23:39 +0100
commitd17612dd6ac42042859b991b8f23f0c99705d8f5 (patch)
tree51ee8a0e597a5975e6c645912542bc11a9904667
parentpimd: Convert qpim_t_periodic into the `struct pim_router` structure (diff)
downloadfrr-d17612dd6ac42042859b991b8f23f0c99705d8f5.tar.xz
frr-d17612dd6ac42042859b991b8f23f0c99705d8f5.zip
pimd: Move the infinite_assert_metric global to pim_router
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_ifchannel.c2
-rw-r--r--pimd/pim_instance.h3
-rw-r--r--pimd/pim_macro.c2
-rw-r--r--pimd/pim_upstream.c4
-rw-r--r--pimd/pimd.c30
-rw-r--r--pimd/pimd.h1
6 files changed, 22 insertions, 20 deletions
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index a96404c8d..14ce8d7d9 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -415,7 +415,7 @@ void reset_ifassert_state(struct pim_ifchannel *ch)
THREAD_OFF(ch->t_ifassert_timer);
pim_ifassert_winner_set(ch, PIM_IFASSERT_NOINFO, any,
- qpim_infinite_assert_metric);
+ router->infinite_assert_metric);
}
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
diff --git a/pimd/pim_instance.h b/pimd/pim_instance.h
index ed8ecdcaa..9f36b9c30 100644
--- a/pimd/pim_instance.h
+++ b/pimd/pim_instance.h
@@ -23,6 +23,7 @@
#include "pim_str.h"
#include "pim_msdp.h"
+#include "pim_assert.h"
#if defined(HAVE_LINUX_MROUTE_H)
#include <linux/mroute.h>
@@ -35,6 +36,7 @@
#define MAXVIFS (256)
#endif
#endif
+
extern struct pim_instance *pimg; // Pim Global Instance
enum pim_spt_switchover {
@@ -48,6 +50,7 @@ struct pim_router {
uint32_t debugs;
int t_periodic;
+ struct pim_assert_metric infinite_assert_metric;
};
/* Per VRF PIM DB */
diff --git a/pimd/pim_macro.c b/pimd/pim_macro.c
index 13f4240db..908026ab1 100644
--- a/pimd/pim_macro.c
+++ b/pimd/pim_macro.c
@@ -295,7 +295,7 @@ pim_macro_ch_my_assert_metric_eval(const struct pim_ifchannel *ch)
}
}
- return qpim_infinite_assert_metric;
+ return router->infinite_assert_metric;
}
/*
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 8cb6c0c17..c6ab8f5a2 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -647,9 +647,9 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
up->rpf.source_nexthop.mrib_nexthop_addr.u.prefix4.s_addr =
PIM_NET_INADDR_ANY;
up->rpf.source_nexthop.mrib_metric_preference =
- qpim_infinite_assert_metric.metric_preference;
+ router->infinite_assert_metric.metric_preference;
up->rpf.source_nexthop.mrib_route_metric =
- qpim_infinite_assert_metric.route_metric;
+ router->infinite_assert_metric.route_metric;
up->rpf.rpf_addr.family = AF_INET;
up->rpf.rpf_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY;
diff --git a/pimd/pimd.c b/pimd/pimd.c
index 33aac5a26..2a37477fb 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -51,7 +51,6 @@ DEFINE_MTYPE_STATIC(PIMD, ROUTER, "PIM Router information");
struct pim_router *router = NULL;
-struct pim_assert_metric qpim_infinite_assert_metric;
long qpim_rpf_cache_refresh_delay_msec = 50;
int qpim_packet_process = PIM_DEFAULT_PACKET_PROCESS;
struct pim_instance *pimg = NULL;
@@ -89,6 +88,21 @@ void pim_router_init(void)
router->debugs = 0;
router->master = frr_init();
router->t_periodic = PIM_DEFAULT_T_PERIODIC;
+
+ /*
+ RFC 4601: 4.6.3. Assert Metrics
+
+ assert_metric
+ infinite_assert_metric() {
+ return {1,infinity,infinity,0}
+ }
+ */
+ router->infinite_assert_metric.rpt_bit_flag = 1;
+ router->infinite_assert_metric.metric_preference =
+ PIM_ASSERT_METRIC_PREFERENCE_MAX;
+ router->infinite_assert_metric.route_metric =
+ PIM_ASSERT_ROUTE_METRIC_MAX;
+ router->infinite_assert_metric.ip_address.s_addr = INADDR_ANY;
}
void pim_router_terminate(void)
@@ -108,20 +122,6 @@ void pim_init(void)
return;
}
- /*
- RFC 4601: 4.6.3. Assert Metrics
-
- assert_metric
- infinite_assert_metric() {
- return {1,infinity,infinity,0}
- }
- */
- qpim_infinite_assert_metric.rpt_bit_flag = 1;
- qpim_infinite_assert_metric.metric_preference =
- PIM_ASSERT_METRIC_PREFERENCE_MAX;
- qpim_infinite_assert_metric.route_metric = PIM_ASSERT_ROUTE_METRIC_MAX;
- qpim_infinite_assert_metric.ip_address.s_addr = INADDR_ANY;
-
pim_cmd_init();
}
diff --git a/pimd/pimd.h b/pimd/pimd.h
index 84d3b4021..2c13b5613 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -135,7 +135,6 @@ const char *const PIM_ALL_IGMP_ROUTERS;
extern struct pim_router *router;
extern struct zebra_privs_t pimd_privs;
struct in_addr qpim_all_pim_routers_addr;
-struct pim_assert_metric qpim_infinite_assert_metric;
long qpim_rpf_cache_refresh_delay_msec;
extern int qpim_packet_process;
extern uint8_t qpim_ecmp_enable;