]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: add vtep_ip to rmac nh_list in all cases
authorChristopher Dziomba <christopher.dziomba@telekom.de>
Thu, 17 Apr 2025 08:41:06 +0000 (10:41 +0200)
committerChristopher Dziomba <christopher.dziomba@telekom.de>
Tue, 22 Apr 2025 15:22:43 +0000 (17:22 +0200)
zebra rmac has a nh_list which tracks the assigned VTEP IPs to RMACs.
It can also receive IPv6 encoded IPv4 addresses as VTEPs. Changing/
Installing the RMAC into the Kernel is only important when the IPv4
address changes. However because nh_list is a nodup list used to
track usage or RMACs by VTEP IPs, both IP addresses (IPv4 and IPv6
encoded IPv4) should be written into it, as both could be removed
in l3vni_rmac_nh_list_nh_delete independently.

Signed-off-by: Christopher Dziomba <christopher.dziomba@telekom.de>
zebra/zebra_vxlan.c

index 6a0cee6cedc495344685be7e2e866d194848af5a..1dd212cea1657236a6d3943536497f05f18e8aea 100644 (file)
@@ -1390,23 +1390,22 @@ static int zl3vni_remote_rmac_add(struct zebra_l3vni *zl3vni,
 
                /* install rmac in kernel */
                zl3vni_rmac_install(zl3vni, zrmac);
-       } else if (!IPV4_ADDR_SAME(&zrmac->fwd_info.r_vtep_ip,
-                                  &(ipv4_vtep.ipaddr_v4))) {
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug(
-                               "L3VNI %u Remote VTEP change(%pI4 -> %pIA) for RMAC %pEA",
-                               zl3vni->vni, &zrmac->fwd_info.r_vtep_ip,
-                               vtep_ip, rmac);
+       } else {
+               if (!IPV4_ADDR_SAME(&zrmac->fwd_info.r_vtep_ip, &(ipv4_vtep.ipaddr_v4))) {
+                       if (IS_ZEBRA_DEBUG_VXLAN)
+                               zlog_debug("L3VNI %u Remote VTEP change(%pI4 -> %pIA) for RMAC %pEA",
+                                          zl3vni->vni, &zrmac->fwd_info.r_vtep_ip, vtep_ip, rmac);
 
-               zrmac->fwd_info.r_vtep_ip = ipv4_vtep.ipaddr_v4;
+                       zrmac->fwd_info.r_vtep_ip = ipv4_vtep.ipaddr_v4;
+
+                       /* install rmac in kernel */
+                       zl3vni_rmac_install(zl3vni, zrmac);
+               }
 
                vtep = XCALLOC(MTYPE_EVPN_VTEP, sizeof(struct ipaddr));
                memcpy(vtep, vtep_ip, sizeof(struct ipaddr));
                if (!listnode_add_sort_nodup(zrmac->nh_list, (void *)vtep))
                        XFREE(MTYPE_EVPN_VTEP, vtep);
-
-               /* install rmac in kernel */
-               zl3vni_rmac_install(zl3vni, zrmac);
        }
 
        return 0;