* to the MLAG peer which may mroute it over the underlay if there are any
* interested receivers.
*/
-static void pim_vxlan_sg_peerlink_update(struct hash_backet *backet, void *arg)
+static void pim_vxlan_sg_peerlink_oif_update(struct hash_backet *backet,
+ void *arg)
{
struct interface *new_oif = (struct interface *)arg;
struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
struct in_addr *reg_addr)
{
struct pim_instance *pim;
- struct interface *old_oif;
- struct interface *new_oif;
char addr_buf[INET_ADDRSTRLEN];
struct pim_interface *pim_ifp = NULL;
*/
pim = pim_get_pim_instance(VRF_DEFAULT);
- old_oif = pim_vxlan_orig_mr_oif_get(pim);
-
if (enable)
vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED;
else
pim_vxlan_set_peerlink_rif(pim, peerlink_rif);
else
pim_vxlan_set_peerlink_rif(pim, NULL);
-
- new_oif = pim_vxlan_orig_mr_oif_get(pim);
- if (old_oif != new_oif)
- hash_iterate(pim->vxlan.sg_hash, pim_vxlan_sg_peerlink_update,
- new_oif);
}
/****************************** misc callbacks *******************************/
struct interface *ifp)
{
struct interface *old_iif;
+ struct interface *new_iif;
+ struct interface *old_oif;
+ struct interface *new_oif;
if (pim->vxlan.peerlink_rif == ifp)
return;
ifp ? ifp->name : "-");
old_iif = pim_vxlan_orig_mr_iif_get(pim);
+ old_oif = pim_vxlan_orig_mr_oif_get(pim);
pim->vxlan.peerlink_rif = ifp;
- ifp = pim_vxlan_orig_mr_iif_get(pim);
- if (old_iif == ifp)
- return;
- if (PIM_DEBUG_VXLAN)
- zlog_debug("%s: vxlan orig iif changed from %s to %s",
- __PRETTY_FUNCTION__, old_iif ? old_iif->name : "-",
- ifp ? ifp->name : "-");
+ new_iif = pim_vxlan_orig_mr_iif_get(pim);
+ if (old_iif != new_iif) {
+ if (PIM_DEBUG_VXLAN)
+ zlog_debug("%s: vxlan orig iif changed from %s to %s",
+ __PRETTY_FUNCTION__,
+ old_iif ? old_iif->name : "-",
+ new_iif ? new_iif->name : "-");
- /* add/del upstream entries for the existing vxlan SG when the
- * interface becomes available
- */
- if (pim->vxlan.sg_hash)
- hash_iterate(pim->vxlan.sg_hash,
- pim_vxlan_sg_peerlink_rif_update, old_iif);
+ /* add/del upstream entries for the existing vxlan SG when the
+ * interface becomes available
+ */
+ if (pim->vxlan.sg_hash)
+ hash_iterate(pim->vxlan.sg_hash,
+ pim_vxlan_sg_peerlink_rif_update,
+ old_iif);
+ }
+
+ new_oif = pim_vxlan_orig_mr_oif_get(pim);
+ if (old_oif != new_oif) {
+ if (PIM_DEBUG_VXLAN)
+ zlog_debug("%s: vxlan orig oif changed from %s to %s",
+ __PRETTY_FUNCTION__,
+ old_oif ? old_oif->name : "-",
+ new_oif ? new_oif->name : "-");
+ if (pim->vxlan.sg_hash)
+ hash_iterate(pim->vxlan.sg_hash,
+ pim_vxlan_sg_peerlink_oif_update,
+ new_oif);
+ }
}
void pim_vxlan_add_vif(struct interface *ifp)