From: anuradhak Date: Thu, 1 Dec 2016 23:46:36 +0000 (-0800) Subject: pimd: restart the ka timer after the sa adv timer X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~47 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=69053fb4f0bf1b66a91b28e43c1a9a64db739d65;p=matthieu%2Ffrr.git pimd: restart the ka timer after the sa adv timer To avoid unnecessary ka activity in the network. When the SA advertisment timer fires we build SA TLVs and send them to peers. As a part of this tx we were also restarting the ka timer to avoid unnecessary ka generation in the next 60 seconds. However because the adv timer was restarted after tx (i.e. after ka restart) ka timer would always endup firing just before the adv timer. --- diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index 3562a0e348..d327984132 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -73,8 +73,8 @@ pim_msdp_sa_adv_timer_cb(struct thread *t) zlog_debug("MSDP SA advertisment timer expired"); } - pim_msdp_pkt_sa_tx(); pim_msdp_sa_adv_timer_setup(true /* start */); + pim_msdp_pkt_sa_tx(); return 0; } static void @@ -974,6 +974,9 @@ pim_msdp_peer_pkt_txed(struct pim_msdp_peer *mp) { if (mp->state == PIM_MSDP_ESTABLISHED) { pim_msdp_peer_ka_timer_setup(mp, true /* start */); + if (PIM_DEBUG_MSDP_INTERNAL) { + zlog_debug("MSDP ka timer restart on pkt tx to %s", mp->key_str); + } } } diff --git a/pimd/pim_msdp_packet.c b/pimd/pim_msdp_packet.c index 8ee45813ca..3f3f9d1de0 100644 --- a/pimd/pim_msdp_packet.c +++ b/pimd/pim_msdp_packet.c @@ -194,7 +194,7 @@ pim_msdp_write(struct thread *thread) enum pim_msdp_tlv type; int len; int work_cnt = 0; - int work_max_cnt = 1; + int work_max_cnt = 12; mp = THREAD_ARG(thread); mp->t_write = NULL;