struct pim_instance *pim = THREAD_ARG(t);
if (PIM_DEBUG_MSDP_EVENTS) {
- zlog_debug("MSDP SA advertisment timer expired");
+ zlog_debug("MSDP SA advertisement timer expired");
}
pim_msdp_sa_adv_timer_setup(pim, true /* start */);
if (PIM_UPSTREAM_FLAG_TEST_SRC_MSDP(up->flags)) {
PIM_UPSTREAM_FLAG_UNSET_SRC_MSDP(up->flags);
sa->flags |= PIM_MSDP_SAF_UP_DEL_IN_PROG;
- pim_upstream_del(sa->pim, up, __PRETTY_FUNCTION__);
+ up = pim_upstream_del(sa->pim, up, __PRETTY_FUNCTION__);
+ /* re-eval joinDesired; clearing peer-msdp-sa flag can
+ * cause JD to change
+ */
+ if (up)
+ pim_upstream_update_join_desired(sa->pim, up);
sa->flags &= ~PIM_MSDP_SAF_UP_DEL_IN_PROG;
}
return false;
}
- if (!up->t_ka_timer) {
+ if (!pim_upstream_is_kat_running(up))
/* stream is not active */
return false;
- }
if (!I_am_RP(pim, up->sg.grp)) {
/* we are not RP for the group */
}
/* sa hash and peer list helpers */
-static unsigned int pim_msdp_sa_hash_key_make(void *p)
+static unsigned int pim_msdp_sa_hash_key_make(const void *p)
{
- struct pim_msdp_sa *sa = p;
+ const struct pim_msdp_sa *sa = p;
return (jhash_2words(sa->sg.src.s_addr, sa->sg.grp.s_addr, 0));
}
mp->mesh_group_name = XSTRDUP(MTYPE_PIM_MSDP_MG_NAME, mesh_group_name);
mp->state = PIM_MSDP_INACTIVE;
mp->fd = -1;
- strcpy(mp->last_reset, "-");
+ strlcpy(mp->last_reset, "-", sizeof(mp->last_reset));
/* higher IP address is listener */
if (ntohl(mp->local.s_addr) > ntohl(mp->peer.s_addr)) {
mp->flags |= PIM_MSDP_PEERF_LISTENER;
}
/* peer hash and peer list helpers */
-static unsigned int pim_msdp_peer_hash_key_make(void *p)
+static unsigned int pim_msdp_peer_hash_key_make(const void *p)
{
- struct pim_msdp_peer *mp = p;
+ const struct pim_msdp_peer *mp = p;
return (jhash_1word(mp->peer.s_addr, 0));
}
if (PIM_DEBUG_MSDP_EVENTS) {
zlog_debug("MSDP mesh-group %s deleted", mg->mesh_group_name);
}
- if (mg->mesh_group_name)
- XFREE(MTYPE_PIM_MSDP_MG_NAME, mg->mesh_group_name);
+ XFREE(MTYPE_PIM_MSDP_MG_NAME, mg->mesh_group_name);
if (mg->mbr_list)
list_delete(&mg->mbr_list);
}
/*********************** MSDP feature APIs *********************************/
-int pim_msdp_config_write_helper(struct pim_instance *pim, struct vty *vty,
- const char *spaces)
+int pim_msdp_config_write(struct pim_instance *pim, struct vty *vty,
+ const char *spaces)
{
struct listnode *mbrnode;
struct pim_msdp_mg_mbr *mbr;
return count;
}
-int pim_msdp_config_write(struct vty *vty)
-{
- return pim_msdp_config_write_helper(pimg, vty, "");
-}
-
/* Enable feature including active/periodic timers etc. on the first peer
* config. Till then MSDP should just stay quiet. */
static void pim_msdp_enable(struct pim_instance *pim)