diff options
Diffstat (limited to 'bgpd/bgp_zebra.c')
| -rw-r--r-- | bgpd/bgp_zebra.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1cd51cb6f4..2d808a6ffb 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2249,6 +2249,40 @@ static void bgp_zebra_connected(struct zclient *zclient) */ } +static int bgp_zebra_process_local_es(int cmd, struct zclient *zclient, + zebra_size_t length, vrf_id_t vrf_id) +{ + esi_t esi; + struct bgp *bgp = NULL; + struct stream *s = NULL; + char buf[ESI_STR_LEN]; + char buf1[INET6_ADDRSTRLEN]; + struct ipaddr originator_ip; + + memset(&esi, 0, sizeof(esi_t)); + memset(&originator_ip, 0, sizeof(struct ipaddr)); + + bgp = bgp_lookup_by_vrf_id(vrf_id); + if (!bgp) + return 0; + + s = zclient->ibuf; + stream_get(&esi, s, sizeof(esi_t)); + stream_get(&originator_ip, s, sizeof(struct ipaddr)); + + if (BGP_DEBUG(zebra, ZEBRA)) + zlog_debug("Rx %s ESI %s originator-ip %s", + (cmd == ZEBRA_LOCAL_ES_ADD) ? "add" : "del", + esi_to_str(&esi, buf, sizeof(buf)), + ipaddr2str(&originator_ip, buf1, sizeof(buf1))); + + if (cmd == ZEBRA_LOCAL_ES_ADD) + bgp_evpn_local_es_add(bgp, &esi, &originator_ip); + else + bgp_evpn_local_es_del(bgp, &esi, &originator_ip); + return 0; +} + static int bgp_zebra_process_local_l3vni(int cmd, struct zclient *zclient, zebra_size_t length, vrf_id_t vrf_id) { @@ -2484,6 +2518,8 @@ void bgp_zebra_init(struct thread_master *master) zclient->nexthop_update = bgp_read_nexthop_update; zclient->import_check_update = bgp_read_import_check_update; zclient->fec_update = bgp_read_fec_update; + zclient->local_es_add = bgp_zebra_process_local_es; + zclient->local_es_del = bgp_zebra_process_local_es; zclient->local_vni_add = bgp_zebra_process_local_vni; zclient->local_vni_del = bgp_zebra_process_local_vni; zclient->local_macip_add = bgp_zebra_process_local_macip; |
