]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_vxlan.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / pimd / pim_vxlan.c
index c1e7be5870cf828c4a5b4724841a0705f3cc5c2a..4c317a25464aedd082667e6dbe26f87764508bf2 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PIM support for VxLAN BUM flooding
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR 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, or (at your option) any
- * later version.
- *
- * FRR 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.
- * 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.
  */
 
 #include <zebra.h>
@@ -184,11 +169,10 @@ void pim_vxlan_update_sg_reg_state(struct pim_instance *pim,
                pim_vxlan_del_work(vxlan_sg);
 }
 
-static int pim_vxlan_work_timer_cb(struct thread *t)
+static void pim_vxlan_work_timer_cb(struct thread *t)
 {
        pim_vxlan_do_reg_work();
        pim_vxlan_work_timer_setup(true /* start */);
-       return 0;
 }
 
 /* global 1second timer used for periodic processing */
@@ -304,7 +288,6 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
        struct pim_upstream *up;
        struct pim_interface *term_ifp;
        int flags = 0;
-       struct prefix nht_p;
        struct pim_instance *pim = vxlan_sg->pim;
 
        if (vxlan_sg->up) {
@@ -354,11 +337,8 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
                 * iif
                 */
                if (!PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags)) {
-                       nht_p.family = AF_INET;
-                       nht_p.prefixlen = IPV4_MAX_BITLEN;
-                       nht_p.u.prefix4 = up->upstream_addr;
-                       pim_delete_tracked_nexthop(vxlan_sg->pim, &nht_p, up,
-                                                  NULL);
+                       pim_delete_tracked_nexthop(vxlan_sg->pim,
+                                                  up->upstream_addr, up, NULL);
                }
                /* We are acting FHR; clear out use_rpt setting if any */
                pim_upstream_update_use_rpt(up, false /*update_mroute*/);
@@ -883,6 +863,12 @@ void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role,
         */
        pim = pim_get_pim_instance(VRF_DEFAULT);
 
+       if (!pim) {
+               if (PIM_DEBUG_VXLAN)
+                       zlog_debug("%s: Unable to find pim instance", __func__);
+               return;
+       }
+
        if (enable)
                vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED;
        else
@@ -1140,7 +1126,7 @@ void pim_vxlan_add_term_dev(struct pim_instance *pim,
        /* enable pim on the term ifp */
        pim_ifp = (struct pim_interface *)ifp->info;
        if (pim_ifp) {
-               PIM_IF_DO_PIM(pim_ifp->options);
+               pim_ifp->pim_enable = true;
                /* ifp is already oper up; activate it as a term dev */
                if (pim_ifp->mroute_vif_index >= 0)
                        pim_vxlan_term_oif_update(pim, ifp);
@@ -1168,8 +1154,8 @@ void pim_vxlan_del_term_dev(struct pim_instance *pim)
 
        pim_ifp = (struct pim_interface *)ifp->info;
        if (pim_ifp) {
-               PIM_IF_DONT_PIM(pim_ifp->options);
-               if (!PIM_IF_TEST_IGMP(pim_ifp->options))
+               pim_ifp->pim_enable = false;
+               if (!pim_ifp->gm_enable)
                        pim_if_delete(ifp);
        }
 }