]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Allow the keepalive time to be per vrf.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 13 Jul 2017 01:16:00 +0000 (21:16 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 28 Jul 2017 12:03:50 +0000 (08:03 -0400)
Allow the keepalive period to be per vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c
pimd/pim_ifchannel.c
pimd/pim_instance.c
pimd/pim_instance.h
pimd/pim_mroute.c
pimd/pim_register.c
pimd/pim_upstream.c
pimd/pim_vty.c
pimd/pimd.c
pimd/pimd.h

index 8c55dd403d613593d1296be015c2763156901692..9cd73cbbf4b9f5340ea7b012c8c40a43405f1d24 100644 (file)
@@ -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;
 }
 
index 0ee887f8401c1071916f951dad44dfe57cd245ae..db86d070ce12e2a80946814db47cd67aca80af96 100644 (file)
@@ -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:
index fc25f352b96fcb8abf60ab22a481d9c9caa87373..7bee75fae7e8a2ca279b927dfd0cffe887aed4ef 100644 (file)
@@ -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;
 
index 44f3b3c09748b7607559b9dd0afd415a6bd96ff5..d7005df4e5355fefa0160bc5d5ebe687172a010c 100644 (file)
@@ -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);
index 9a76b88edb8987c7b4a43d38930b75e5d525bf51..beb4606a569890ff9c0a6c02e9728a9e557a34f1 100644 (file)
@@ -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;
 
index d0de91bb45ae83f797e83c4caa6de72f08386fb6..a393d0bbda8bacb4256d950e0f263145b8e41806 100644 (file)
@@ -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);
                        }
                }
 
index 96aaff09b0bc51b1e57cd4aec8da2009da7a1295..a8506501e50e5da3c85960999227c8635318169f 100644 (file)
@@ -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);
index 664fbac2c375fb83edf8c1662a222450ad50fd4e..b48bb52f3f641aec9d62c4573adeb85de4136445 100644 (file)
@@ -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) {
index f218b9a79455122cf97b3d635b23d8c513ed0f7b..9a8e92cbb240cf562a8803703d8d75a177205cc9 100644 (file)
@@ -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",
index 0d0d8cfe3062e81fd7e2b375d0fccc9f28c22b55..ed51db3dee33491cc7995d4f58efa213a0b518f9 100644 (file)
@@ -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;