+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* PIM for Quagga
* Copyright (C) 2008 Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
#include "plist.h"
#include "pimd.h"
+#include "pim_instance.h"
#include "pim_macro.h"
#include "pim_iface.h"
#include "pim_ifchannel.h"
return 0; /* false */
}
- if (PIM_INADDR_IS_ANY(ch->ifassert_winner))
+ if (pim_addr_is_any(ch->ifassert_winner))
return 0; /* false */
/* AssertWinner(S,G,I) == me ? */
- if (ch->ifassert_winner.s_addr == pim_ifp->primary_address.s_addr)
+ if (!pim_addr_cmp(ch->ifassert_winner, pim_ifp->primary_address))
return 0; /* false */
spt_assert_metric = pim_macro_spt_assert_metric(
int pim_macro_chisin_pim_include(const struct pim_ifchannel *ch)
{
struct pim_interface *pim_ifp = ch->interface->info;
+ bool mlag_active = false;
if (!pim_ifp) {
zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
return 0; /* false */
/* OR AssertWinner(S,G,I) == me ? */
- if (ch->ifassert_winner.s_addr == pim_ifp->primary_address.s_addr)
+ if (!pim_addr_cmp(ch->ifassert_winner, pim_ifp->primary_address))
return 1; /* true */
+ /*
+ * When we have a activeactive interface we need to signal
+ * that this interface is interesting to the upstream
+ * decision to JOIN *if* we are syncing over the interface
+ */
+ if (pim_ifp->activeactive) {
+ struct pim_upstream *up = ch->upstream;
+
+ if (PIM_UPSTREAM_FLAG_TEST_MLAG_INTERFACE(up->flags))
+ mlag_active = true;
+ }
+
return (
/* I_am_DR( I ) ? */
- PIM_I_am_DR(pim_ifp) &&
+ (PIM_I_am_DR(pim_ifp) || mlag_active) &&
/* lost_assert(S,G,I) == false ? */
(!pim_macro_ch_lost_assert(ch)));
}
}
*/
struct pim_assert_metric pim_macro_spt_assert_metric(const struct pim_rpf *rpf,
- struct in_addr ifaddr)
+ pim_addr ifaddr)
{
struct pim_assert_metric metric;
return 1; /* true */
/* AssertWinner(S,G,I) == me ? */
- if (ch->ifassert_winner.s_addr
- == pim_ifp->primary_address.s_addr)
+ if (!pim_addr_cmp(ch->ifassert_winner,
+ pim_ifp->primary_address))
return 1; /* true */
}