]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: evpn route-map match ead type-1 route-type
authorChirag Shah <chirag@nvidia.com>
Tue, 8 Feb 2022 20:59:16 +0000 (12:59 -0800)
committerChirag Shah <chirag@nvidia.com>
Thu, 17 Feb 2022 17:55:00 +0000 (09:55 -0800)
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 <chirag@nvidia.com>
bgpd/bgp_routemap.c
yang/frr-bgp-route-map.yang

index fa03276f64dab171088adc8db64db79ea52f5788..3bcf2a798642dda4ff004a5c13c3adb43e8fce89 100644 (file)
@@ -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 <macip|2|multicast|3|prefix|5>",
+           "match evpn route-type <ead|1|macip|2|multicast|3|prefix|5>",
            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 <macip|2|multicast|3|prefix|5>",
+           "no match evpn route-type <ead|1|macip|2|multicast|3|prefix|5>",
            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
index 9bd26043a7e95b4951758731d67df69bd710d60f..9d4ac5c9c60863ee3a710554a080fbb22a6cf4b1 100644 (file)
@@ -532,6 +532,11 @@ module frr-bgp-route-map {
             description
               "Prefix route";
           }
+          enum "ead" {
+            value 3;
+            description
+              "Ethernet Auto-Discovery route";
+          }
         }
       }
     }