]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_nhg.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / zebra / zebra_nhg.c
index d0d3c38a22fba6cfe91588e0722787bdc258b058..654cf50d49c267ff3c914a5878beeb77a89bb7f4 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Nexthop Group Code.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Donald Sharp
  *                    Stephen Worley
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
@@ -2771,6 +2755,10 @@ static bool nexthop_list_set_evpn_dvni(struct route_entry *re,
        re_vrf_vni = get_l3vni_vni(re->vrf_id);
 
        for (; nexthop; nexthop = nexthop->next) {
+               if (!nexthop->nh_label ||
+                   nexthop->nh_label_type != ZEBRA_LSP_EVPN)
+                       continue;
+
                nh_vni = label2vni(&nexthop->nh_label->label[0]);
 
                if (nh_vni != re_vrf_vni)
@@ -2848,17 +2836,17 @@ static uint32_t nexthop_list_active_update(struct route_node *rn,
                        counter++;
 
                /* Check for changes to the nexthop - set ROUTE_ENTRY_CHANGED */
-               if (prev_active != new_active || prev_index != nexthop->ifindex
-                   || ((nexthop->type >= NEXTHOP_TYPE_IFINDEX
-                        && nexthop->type < NEXTHOP_TYPE_IPV6)
-                       && prev_src.ipv4.s_addr
-                                  != nexthop->rmap_src.ipv4.s_addr)
-                   || ((nexthop->type >= NEXTHOP_TYPE_IPV6
-                        && nexthop->type < NEXTHOP_TYPE_BLACKHOLE)
-                       && !(IPV6_ADDR_SAME(&prev_src.ipv6,
-                                           &nexthop->rmap_src.ipv6)))
-                   || CHECK_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED)
-                   || vni_removed)
+               if (prev_active != new_active ||
+                   prev_index != nexthop->ifindex ||
+                   ((nexthop->type >= NEXTHOP_TYPE_IFINDEX &&
+                     nexthop->type < NEXTHOP_TYPE_IPV6) &&
+                    prev_src.ipv4.s_addr != nexthop->rmap_src.ipv4.s_addr) ||
+                   ((nexthop->type >= NEXTHOP_TYPE_IPV6 &&
+                     nexthop->type < NEXTHOP_TYPE_BLACKHOLE) &&
+                    !(IPV6_ADDR_SAME(&prev_src.ipv6,
+                                     &nexthop->rmap_src.ipv6))) ||
+                   CHECK_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED) ||
+                   vni_removed)
                        SET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
        }