]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: use evpn type enum for prefix conversion
authorStephen Worley <sworley@nvidia.com>
Fri, 11 Mar 2022 18:28:30 +0000 (13:28 -0500)
committerStephen Worley <sworley@nvidia.com>
Tue, 23 Aug 2022 16:41:25 +0000 (12:41 -0400)
Use the evpn type enum for the evpn_prefix2prefix conversion.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
lib/prefix.c

index a3b8e5c82302a23ad16dba27920cfa797a6995d0..4642f14d35ad0af74572a954b5aec6af32676a86 100644 (file)
@@ -1441,7 +1441,7 @@ int evpn_prefix2prefix(const struct prefix *evpn, struct prefix *to)
        addr = &evpn->u.prefix_evpn;
 
        switch (addr->route_type) {
-       case (2):
+       case BGP_EVPN_MAC_IP_ROUTE:
                if (IS_IPADDR_V4(&addr->macip_addr.ip))
                        ipaddr2prefix(&addr->macip_addr.ip, 32, to);
                else if (IS_IPADDR_V6(&addr->macip_addr.ip))
@@ -1450,7 +1450,7 @@ int evpn_prefix2prefix(const struct prefix *evpn, struct prefix *to)
                        return -1; /* mac only? */
 
                break;
-       case (5):
+       case BGP_EVPN_IP_PREFIX_ROUTE:
                ipaddr2prefix(&addr->prefix_addr.ip,
                              addr->prefix_addr.ip_prefix_length, to);
                break;