]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: fixup JD macro to use "peer-msdp-sa" check instead of I_am_RP check
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Fri, 15 Nov 2019 20:22:27 +0000 (12:22 -0800)
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Fri, 15 Nov 2019 22:16:08 +0000 (14:16 -0800)
JD macro is defined by the RFC as -
bool JoinDesired(S,G) {
    return (immediate_olist(S,G) != NULL
        OR (KeepaliveTimer(S,G) is running
        AND inherited_olist(S,G) != NULL))
}

However for MSDP synced SA the KAT will not be running so an exception is
needed. Earlier I had done this by relaxing KAT_run requirements entirely
on the RP. However as that prevents the source from being aged out in some
cases I have made the check more narrow i.e. has to an MSDP peer added
entry.

Ticket: CM-24398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
pimd/pim_msdp.c
pimd/pim_upstream.c

index 65bfebec3b29e8b7774294abc8ad60980f9c3a2b..8a18594fd72969fa968a332edff8f685f406326e 100644 (file)
@@ -126,7 +126,12 @@ static void pim_msdp_sa_upstream_del(struct pim_msdp_sa *sa)
        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;
        }
 
index 411e767645257ce71a0b9725f64d4d6ee4b429e4..26cc68abf8e1fd3b175d98d15008b1e4c9d14df7 100644 (file)
@@ -933,6 +933,15 @@ void pim_upstream_ref(struct pim_upstream *up, int flags, const char *name)
                pim_upstream_update_use_rpt(up, true /*update_mroute*/);
        }
 
+       /* re-eval joinDesired; clearing peer-msdp-sa flag can
+        * cause JD to change
+        */
+       if (!PIM_UPSTREAM_FLAG_TEST_SRC_MSDP(up->flags) &&
+                       PIM_UPSTREAM_FLAG_TEST_SRC_MSDP(flags)) {
+               PIM_UPSTREAM_FLAG_SET_SRC_MSDP(up->flags);
+               pim_upstream_update_join_desired(up->pim, up);
+       }
+
        up->flags |= flags;
        ++up->ref_count;
        if (PIM_DEBUG_PIM_TRACE)
@@ -1073,6 +1082,12 @@ static bool pim_upstream_empty_immediate_olist(struct pim_instance *pim,
        return true;
 }
 
+
+static inline bool pim_upstream_is_msdp_peer_sa(struct pim_upstream *up)
+{
+       return PIM_UPSTREAM_FLAG_TEST_SRC_MSDP(up->flags);
+}
+
 /*
  *   bool JoinDesired(*,G) {
  *       if (immediate_olist(*,G) != NULL)
@@ -1105,7 +1120,7 @@ int pim_upstream_evaluate_join_desired(struct pim_instance *pim,
        empty_inh_oil = pim_upstream_empty_inherited_olist(up);
        if (!empty_inh_oil &&
                        (pim_upstream_is_kat_running(up) ||
-                        I_am_RP(pim, up->sg.grp)))
+                        pim_upstream_is_msdp_peer_sa(up)))
                return true;
 
        return false;