From 2514d231905f9abc9c8d5783af3da0c672348fc4 Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Thu, 10 Feb 2022 19:35:14 -0800 Subject: [PATCH] bgpd: evpn route-map match esr type-4 route-type Testing: After fix: bharat(config-route-map)# match evpn route-type 1 EAD (Type-1) route 2 MAC-IP (Type-2) route 3 Multicast (Type-3) route 4 Ethernet Segment (Type-4) route <---- 5 Prefix (Type-5) route ead EAD (Type-1) route es Ethernet Segment (Type-4) route macip MAC-IP (Type-2) route multicast Multicast (Type-3) route prefix Prefix (Type-5) route bharat(config-route-map)# match evpn route-type 4 bharat(config-route-map)# do show running-config Building configuration... ... ! route-map ALLOW_EVPN_R permit 10 match evpn route-type es <---- exit BGP: route-map: ALLOW_EVPN_R Invoked: 0 Optimization: enabled Processed Change: false permit, sequence 10 Invoked 0 Match clauses: evpn route-type es <----- Set clauses: Call clause: Action: Exit routemap Signed-off-by: Chirag Shah --- bgpd/bgp_routemap.c | 10 ++++++++-- yang/frr-bgp-route-map.yang | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 3bcf2a7986..efb7f9eb7b 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -1045,6 +1045,8 @@ static void *route_match_evpn_route_type_compile(const char *arg) *route_type = BGP_EVPN_MAC_IP_ROUTE; else if (strncmp(arg, "mu", 2) == 0) *route_type = BGP_EVPN_IMET_ROUTE; + else if (strncmp(arg, "es", 2) == 0) + *route_type = BGP_EVPN_ES_ROUTE; else *route_type = BGP_EVPN_IP_PREFIX_ROUTE; @@ -4169,7 +4171,7 @@ 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 @@ -4179,6 +4181,8 @@ DEFUN_YANG (match_evpn_route_type, EVPN_TYPE_2_HELP_STR EVPN_TYPE_3_HELP_STR EVPN_TYPE_3_HELP_STR + EVPN_TYPE_4_HELP_STR + EVPN_TYPE_4_HELP_STR EVPN_TYPE_5_HELP_STR EVPN_TYPE_5_HELP_STR) { @@ -4198,7 +4202,7 @@ 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 @@ -4209,6 +4213,8 @@ DEFUN_YANG (no_match_evpn_route_type, EVPN_TYPE_2_HELP_STR EVPN_TYPE_3_HELP_STR EVPN_TYPE_3_HELP_STR + EVPN_TYPE_4_HELP_STR + EVPN_TYPE_4_HELP_STR EVPN_TYPE_5_HELP_STR EVPN_TYPE_5_HELP_STR) { diff --git a/yang/frr-bgp-route-map.yang b/yang/frr-bgp-route-map.yang index 9d4ac5c9c6..74008bc078 100644 --- a/yang/frr-bgp-route-map.yang +++ b/yang/frr-bgp-route-map.yang @@ -537,6 +537,11 @@ module frr-bgp-route-map { description "Ethernet Auto-Discovery route"; } + enum "es" { + value 4; + description + "Ethernet Segment route"; + } } } } -- 2.39.5