From: Stephen Worley Date: Fri, 11 Mar 2022 18:28:30 +0000 (-0500) Subject: lib: use evpn type enum for prefix conversion X-Git-Tag: frr-8.4-rc~1^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5ad4fc6ce9b2e8b2161484a5fb86410976cc8fd9;p=matthieu%2Ffrr.git lib: use evpn type enum for prefix conversion Use the evpn type enum for the evpn_prefix2prefix conversion. Signed-off-by: Stephen Worley --- diff --git a/lib/prefix.c b/lib/prefix.c index a3b8e5c823..4642f14d35 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -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;