summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-07-12 21:16:00 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-28 08:03:50 -0400
commit19b807ca178f017c57f3abf36d21c93d641cec50 (patch)
tree9c208173f1fc7690a75afb4af9164ebd2911e5a9
parent9fb302f41d836328ad56588036eaf43fe84e2ddf (diff)
pimd: Allow the keepalive time to be per vrf.
Allow the keepalive period to be per vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_cmd.c4
-rw-r--r--pimd/pim_ifchannel.c2
-rw-r--r--pimd/pim_instance.c4
-rw-r--r--pimd/pim_instance.h3
-rw-r--r--pimd/pim_mroute.c10
-rw-r--r--pimd/pim_register.c4
-rw-r--r--pimd/pim_upstream.c6
-rw-r--r--pimd/pim_vty.c4
-rw-r--r--pimd/pimd.c4
-rw-r--r--pimd/pimd.h2
10 files changed, 22 insertions, 21 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 8c55dd403d..9cd73cbbf4 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -5161,7 +5161,7 @@ DEFUN (ip_pim_keep_alive,
"Seconds\n")
{
PIM_DECLVAR_CONTEXT(vrf, pim);
- qpim_keep_alive_time = atoi(argv[3]->arg);
+ pim->keep_alive_time = atoi(argv[3]->arg);
return CMD_SUCCESS;
}
@@ -5175,7 +5175,7 @@ DEFUN (no_ip_pim_keep_alive,
"Seconds\n")
{
PIM_DECLVAR_CONTEXT(vrf, pim);
- qpim_keep_alive_time = PIM_KEEPALIVE_PERIOD;
+ pim->keep_alive_time = PIM_KEEPALIVE_PERIOD;
return CMD_SUCCESS;
}
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index 0ee887f840..db86d070ce 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -844,7 +844,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,
PIM_UPSTREAM_FLAG_MASK_SRC_LHR,
__PRETTY_FUNCTION__);
pim_upstream_keep_alive_timer_start(
- ch->upstream, qpim_keep_alive_time);
+ ch->upstream, pim_ifp->pim->keep_alive_time);
}
break;
case PIM_IFJOIN_JOIN:
diff --git a/pimd/pim_instance.c b/pimd/pim_instance.c
index fc25f352b9..7bee75fae7 100644
--- a/pimd/pim_instance.c
+++ b/pimd/pim_instance.c
@@ -74,6 +74,10 @@ static struct pim_instance *pim_instance_init(struct vrf *vrf)
pim_if_init(pim);
+ pim->keep_alive_time = PIM_KEEPALIVE_PERIOD;
+ pim->rp_keep_alive_time = PIM_RP_KEEPALIVE_PERIOD;
+
+
pim->vrf_id = vrf->vrf_id;
pim->vrf = vrf;
diff --git a/pimd/pim_instance.h b/pimd/pim_instance.h
index 44f3b3c097..d7005df4e5 100644
--- a/pimd/pim_instance.h
+++ b/pimd/pim_instance.h
@@ -88,6 +88,9 @@ struct pim_instance {
struct list *ssmpingd_list;
struct in_addr ssmpingd_group_addr;
+
+ unsigned int keep_alive_time;
+ unsigned int rp_keep_alive_time;
};
void pim_vrf_init(void);
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index 9a76b88edb..beb4606a56 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -204,7 +204,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
}
PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
- pim_upstream_keep_alive_timer_start(up, qpim_keep_alive_time);
+ pim_upstream_keep_alive_timer_start(up, pim_ifp->pim->keep_alive_time);
up->channel_oil->cc.pktcnt++;
PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
@@ -258,7 +258,7 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
return 0;
}
pim_upstream_keep_alive_timer_start(
- up, qpim_keep_alive_time);
+ up, pim_ifp->pim->keep_alive_time);
pim_upstream_inherited_olist(pim_ifp->pim, up);
pim_upstream_switch(pim_ifp->pim, up,
PIM_UPSTREAM_JOINED);
@@ -507,7 +507,7 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
}
pim_upstream_keep_alive_timer_start(
- up, qpim_keep_alive_time);
+ up, pim_ifp->pim->keep_alive_time);
pim_upstream_inherited_olist(pim_ifp->pim, up);
pim_mroute_msg_wholepkt(fd, ifp, buf);
}
@@ -530,7 +530,7 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
return -2;
}
PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
- pim_upstream_keep_alive_timer_start(up, qpim_keep_alive_time);
+ pim_upstream_keep_alive_timer_start(up, pim_ifp->pim->keep_alive_time);
up->channel_oil = oil;
up->channel_oil->cc.pktcnt++;
pim_register_join(up);
@@ -978,7 +978,7 @@ void pim_mroute_update_counters(struct channel_oil *c_oil)
c_oil->cc.oldwrong_if = c_oil->cc.wrong_if;
if (!c_oil->installed) {
- c_oil->cc.lastused = 100 * qpim_keep_alive_time;
+ c_oil->cc.lastused = 100 * pim->keep_alive_time;
if (PIM_DEBUG_MROUTE) {
struct prefix_sg sg;
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index d0de91bb45..a393d0bbda 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -417,10 +417,10 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
|| (SwitchToSptDesired(pim_ifp->pim, &sg))) {
if (sentRegisterStop) {
pim_upstream_keep_alive_timer_start(
- upstream, qpim_rp_keep_alive_time);
+ upstream, pim_ifp->pim->rp_keep_alive_time);
} else {
pim_upstream_keep_alive_timer_start(
- upstream, qpim_keep_alive_time);
+ upstream, pim_ifp->pim->keep_alive_time);
}
}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 96aaff09b0..a8506501e5 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -541,7 +541,7 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
&& PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(
up->flags)) {
pim_upstream_keep_alive_timer_start(
- up, qpim_keep_alive_time);
+ up, pim->keep_alive_time);
pim_register_join(up);
}
} else {
@@ -1664,9 +1664,9 @@ static void pim_upstream_sg_running(void *arg)
PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
pim_upstream_fhr_kat_start(up);
}
- pim_upstream_keep_alive_timer_start(up, qpim_keep_alive_time);
+ pim_upstream_keep_alive_timer_start(up, pim->keep_alive_time);
} else if (PIM_UPSTREAM_FLAG_TEST_SRC_LHR(up->flags))
- pim_upstream_keep_alive_timer_start(up, qpim_keep_alive_time);
+ pim_upstream_keep_alive_timer_start(up, pim->keep_alive_time);
if (up->sptbit != PIM_UPSTREAM_SPTBIT_TRUE) {
pim_upstream_set_sptbit(up, up->rpf.source_nexthop.interface);
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index 664fbac2c3..b48bb52f3f 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -178,9 +178,9 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty)
qpim_t_periodic);
++writes;
}
- if (qpim_keep_alive_time != PIM_KEEPALIVE_PERIOD) {
+ if (pim->keep_alive_time != PIM_KEEPALIVE_PERIOD) {
vty_out(vty, "%sip pim keep-alive-timer %d\n", spaces,
- qpim_keep_alive_time);
+ pim->keep_alive_time);
++writes;
}
if (qpim_packet_process != PIM_DEFAULT_PACKET_PROCESS) {
diff --git a/pimd/pimd.c b/pimd/pimd.c
index f218b9a794..9a8e92cbb2 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -58,8 +58,6 @@ int64_t qpim_rpf_cache_refresh_events = 0;
int64_t qpim_rpf_cache_refresh_last = 0;
int64_t qpim_scan_oil_events = 0;
int64_t qpim_scan_oil_last = 0;
-unsigned int qpim_keep_alive_time = PIM_KEEPALIVE_PERIOD;
-signed int qpim_rp_keep_alive_time = 0;
int64_t qpim_nexthop_lookups = 0;
int qpim_packet_process = PIM_DEFAULT_PACKET_PROCESS;
uint8_t qpim_ecmp_enable = 0;
@@ -97,8 +95,6 @@ static void pim_free()
void pim_init()
{
- qpim_rp_keep_alive_time = PIM_RP_KEEPALIVE_PERIOD;
-
if (!inet_aton(PIM_ALL_PIM_ROUTERS, &qpim_all_pim_routers_addr)) {
zlog_err(
"%s %s: could not solve %s to group address: errno=%d: %s",
diff --git a/pimd/pimd.h b/pimd/pimd.h
index 0d0d8cfe30..ed51db3dee 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -142,8 +142,6 @@ int64_t qpim_rpf_cache_refresh_last;
int64_t qpim_scan_oil_events;
int64_t qpim_scan_oil_last;
int64_t qpim_nexthop_lookups;
-extern unsigned int qpim_keep_alive_time;
-extern signed int qpim_rp_keep_alive_time;
extern int qpim_packet_process;
extern uint8_t qpim_ecmp_enable;
extern uint8_t qpim_ecmp_rebalance_enable;