summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-08-04 21:55:44 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-08-08 18:55:03 +0200
commit0f6476ccc3dcd8d7bb3e254ef9e919f5163475fe (patch)
treeb9665264d14026e5892a83263ab673d47e8d1e61 /bgpd/bgp_routemap.c
parentlib, bgpd: Distinguish between AF_EVPN and AF_ETHERNET (diff)
downloadfrr-0f6476ccc3dcd8d7bb3e254ef9e919f5163475fe.tar.xz
frr-0f6476ccc3dcd8d7bb3e254ef9e919f5163475fe.zip
lib, bgpd: Use 'struct prefix *' for filter matching
There is no need for special casing of mac addresses, since the mac address is it's own type integrated into `struct prefix` now. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r--bgpd/bgp_routemap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 69b798a01..a8e111d36 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -585,6 +585,7 @@ static route_map_result_t route_match_mac_address(void *rule,
void *object)
{
struct access_list *alist;
+ struct prefix p;
if (type == RMAP_BGP) {
alist = access_list_lookup(AFI_L2VPN, (char *)rule);
@@ -594,7 +595,11 @@ static route_map_result_t route_match_mac_address(void *rule,
if (prefix->u.prefix_evpn.route_type != BGP_EVPN_MAC_IP_ROUTE)
return RMAP_NOMATCH;
- return (access_list_apply(alist, &(prefix->u.prefix_evpn.mac))
+ p.family = AF_ETHERNET;
+ p.prefixlen = ETH_ALEN * 8;
+ p.u.prefix_eth = prefix->u.prefix_evpn.mac;
+
+ return (access_list_apply(alist, &p)
== FILTER_DENY
? RMAP_NOMATCH
: RMAP_MATCH);