Fix pim register spamming when creating MRT on Register
Fixes
@@ -691,24 +691,16 @@ int receive_pim_register(uint32_t reg_src, uint32_t reg_dst, char *msg, size_t l
return FALSE;
}
- mrtentry = find_route(inner_src, inner_grp, MRTF_SG | MRTF_WC | MRTF_PMBR, DONT_CREATE);
+ mrtentry = find_route(inner_src, inner_grp, MRTF_WC, DONT_CREATE);
if (!mrtentry) {
- /* No routing entry. Send REGISTER_STOP and return. */
IF_DEBUG(DEBUG_PIM_REGISTER)
- logit(LOG_DEBUG, 0, "No routing entry for source %s and/or group %s" ,
- inet_fmt(inner_src, s1, sizeof(s1)), inet_fmt(inner_grp, s2, sizeof(s2)));
+ logit(LOG_DEBUG, 0, "Not interested in group %s yet", inet_fmt(inner_grp, s2, sizeof(s2)));
/* TODO: XXX: shouldn't it be inner_src=INADDR_ANY? Not in the spec. */
send_pim_register_stop(reg_dst, reg_src, inner_grp, inner_src);
-#if 0 /* Disabled due to regression, see https://github.com/troglobit/pimd/issues/128 */
- /* Create mrtentry for forthcoming join requests. Once one occurs
- * we know who is sending to this group and can send join to
- * that immediately. Saves 0 - 60 seconds not to wait next
- * PIM Register.
- */
mrtentry = find_route(inner_src, inner_grp, MRTF_SG, CREATE);
- if (!mrtentry)
+ if (!mrtentry || !(mrtentry->flags & MRTF_NEW))
return TRUE;
SET_TIMER(mrtentry->timer, PIM_DATA_TIMEOUT);
@@ -719,11 +711,12 @@ int receive_pim_register(uint32_t reg_src, uint32_t reg_dst, char *msg, size_t l
mrtentry->pruned_oifs,
mrtentry->leaves,
mrtentry->asserted_oifs, 0);
-#endif
return TRUE;
}
+ mrtentry = find_route(inner_src, inner_grp, MRTF_SG | MRTF_WC | MRTF_PMBR, DONT_CREATE);
+
/* Check if I am the RP for that group */
if ((local_address(reg_dst) == NO_VIF) || !check_mrtentry_rp(mrtentry, reg_dst)) {
IF_DEBUG(DEBUG_PIM_REGISTER)
