]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_oil.c
bgpd: fix the IGP metric for best path selection on VPN import
[mirror_frr.git] / pimd / pim_oil.c
index d5e459b44e98cb855ecfd1b7e45fd310ec9cf65b..3bfb31e0c6978d6a83588e95b3d8577bd21002d0 100644 (file)
@@ -255,7 +255,7 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,
                return 0;
        }
 
-       oil_if_set(channel_oil, pim_ifp->mroute_vif_index, false);
+       oil_if_set(channel_oil, pim_ifp->mroute_vif_index, 0);
        /* clear mute; will be re-evaluated when the OIF becomes valid again */
        channel_oil->oif_flags[pim_ifp->mroute_vif_index] &= ~PIM_OIF_FLAG_MUTE;
 
@@ -429,6 +429,8 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,
        /* Prevent single protocol from subscribing same interface to
           channel (S,G) multiple times */
        if (channel_oil->oif_flags[pim_ifp->mroute_vif_index] & proto_mask) {
+               channel_oil->oif_flags[pim_ifp->mroute_vif_index] |= proto_mask;
+
                if (PIM_DEBUG_MROUTE) {
                        zlog_debug(
                                "%s %s: existing protocol mask %u requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%pPAs,%pPAs)",
@@ -544,6 +546,8 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,
 
 int pim_channel_oil_empty(struct channel_oil *c_oil)
 {
+       static struct channel_oil null_oil;
+
        if (!c_oil)
                return 1;
 
@@ -551,13 +555,10 @@ int pim_channel_oil_empty(struct channel_oil *c_oil)
         * non-NULL.
         * pimreg device (in all vrfs) uses a vifi of
         * 0 (PIM_OIF_PIM_REGISTER_VIF) so we simply mfcc_ttls[0] */
-#if PIM_IPV == 4
-       static pim_mfcctl null_oil;
-
-       return !memcmp(&c_oil->oil.mfcc_ttls[1], &null_oil.mfcc_ttls[1],
-               sizeof(null_oil.mfcc_ttls) - sizeof(null_oil.mfcc_ttls[0]));
-#else
-       CPP_NOTICE("FIXME STUB");
-       return false;
-#endif
+       if (oil_if_has(c_oil, 0))
+               oil_if_set(&null_oil, 0, 1);
+       else
+               oil_if_set(&null_oil, 0, 0);
+
+       return !oil_if_cmp(&c_oil->oil, &null_oil.oil);
 }