From: Chirag Shah Date: Tue, 8 Feb 2022 20:59:16 +0000 (-0800) Subject: bgpd: evpn route-map match ead type-1 route-type X-Git-Tag: pim6-testing-20220430~309^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=bd44ab083155186c21d5296e91bf211627370453;p=matthieu%2Ffrr.git bgpd: evpn route-map match ead type-1 route-type Add evpn mh route type-1 (EAD) to match clause of route-map. Ticket: issue#10461 Reviewed By: Testing Done: With fix: vtep1(config-route-map)# match evpn route-type 1 EAD (Type-1) route 2 MAC-IP (Type-2) route 3 Multicast (Type-3) route 5 Prefix (Type-5) route ead EAD (Type-1) route macip MAC-IP (Type-2) route multicast Multicast (Type-3) route prefix Prefix (Type-5) route vtep1# show running-config bgpd .... route-map HOST_ALLOW_1 permit 1 match evpn route-type ead vtep1# show route-map HOST_ALLOW_1 BGP: route-map: HOST_ALLOW_1 Invoked: 6 Optimization: disabled Processed Change: false permit, sequence 1 Invoked 6 Match clauses: ip address prefix-list LOCAL_HOST_VRF1 evpn route-type ead Signed-off-by: Chirag Shah --- diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index fa03276f64..3bcf2a7986 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -1039,7 +1039,9 @@ static void *route_match_evpn_route_type_compile(const char *arg) route_type = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t)); - if (strncmp(arg, "ma", 2) == 0) + if (strncmp(arg, "ea", 2) == 0) + *route_type = BGP_EVPN_AD_ROUTE; + else if (strncmp(arg, "ma", 2) == 0) *route_type = BGP_EVPN_MAC_IP_ROUTE; else if (strncmp(arg, "mu", 2) == 0) *route_type = BGP_EVPN_IMET_ROUTE; @@ -4167,10 +4169,12 @@ static const char *parse_evpn_rt_type(const char *num_rt_type) DEFUN_YANG (match_evpn_route_type, match_evpn_route_type_cmd, - "match evpn route-type ", + "match evpn route-type ", MATCH_STR EVPN_HELP_STR EVPN_TYPE_HELP_STR + EVPN_TYPE_1_HELP_STR + EVPN_TYPE_1_HELP_STR EVPN_TYPE_2_HELP_STR EVPN_TYPE_2_HELP_STR EVPN_TYPE_3_HELP_STR @@ -4194,11 +4198,13 @@ DEFUN_YANG (match_evpn_route_type, DEFUN_YANG (no_match_evpn_route_type, no_match_evpn_route_type_cmd, - "no match evpn route-type ", + "no match evpn route-type ", NO_STR MATCH_STR EVPN_HELP_STR EVPN_TYPE_HELP_STR + EVPN_TYPE_1_HELP_STR + EVPN_TYPE_1_HELP_STR EVPN_TYPE_2_HELP_STR EVPN_TYPE_2_HELP_STR EVPN_TYPE_3_HELP_STR diff --git a/yang/frr-bgp-route-map.yang b/yang/frr-bgp-route-map.yang index 9bd26043a7..9d4ac5c9c6 100644 --- a/yang/frr-bgp-route-map.yang +++ b/yang/frr-bgp-route-map.yang @@ -532,6 +532,11 @@ module frr-bgp-route-map { description "Prefix route"; } + enum "ead" { + value 3; + description + "Ethernet Auto-Discovery route"; + } } } }