diff options
| author | Xiao Liang <shaw.leon@gmail.com> | 2022-12-15 17:04:32 +0800 |
|---|---|---|
| committer | Xiao Liang <shaw.leon@gmail.com> | 2023-07-27 15:07:42 +0800 |
| commit | cea3f7f25a23e485d4f814b670c11c92249568e1 (patch) | |
| tree | d1a44bda931904553f9384f3ebfa063d6766a0b9 /zebra/zebra_rib.c | |
| parent | 49f04841131b917ac6218ecba933af36f51a7f91 (diff) | |
lib, zebra: Fix EVPN nexthop config order
Delay EVPN route addition to synchronize with rib_delete(), which now
uses early route queue.
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c61b37a697..780d3c8991 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2706,6 +2706,8 @@ static void process_subq_early_route_add(struct zebra_early_route *ere) return; } } else { + struct nexthop *tmp_nh; + /* Lookup nhe from route information */ nhe = zebra_nhg_rib_find_nhe(ere->re_nhe, ere->afi); if (!nhe) { @@ -2723,6 +2725,22 @@ static void process_subq_early_route_add(struct zebra_early_route *ere) early_route_memory_free(ere); return; } + for (ALL_NEXTHOPS(nhe->nhg, tmp_nh)) { + if (CHECK_FLAG(tmp_nh->flags, NEXTHOP_FLAG_EVPN)) { + struct ipaddr vtep_ip = {}; + + if (ere->afi == AFI_IP) { + vtep_ip.ipa_type = IPADDR_V4; + vtep_ip.ipaddr_v4 = tmp_nh->gate.ipv4; + } else { + vtep_ip.ipa_type = IPADDR_V6; + vtep_ip.ipaddr_v6 = tmp_nh->gate.ipv6; + } + zebra_rib_queue_evpn_route_add( + re->vrf_id, &tmp_nh->rmac, &vtep_ip, + &ere->p); + } + } } /* |
