diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 1921a9553e..682bdb0075 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3093,6 +3093,13 @@ void bgp_evpn_advertise_type5_routes(struct bgp *bgp_vrf, struct prefix_evpn evp; char buf[PREFIX_STRLEN]; + if (!rn->info) + continue; + + /* only advertise subnet routes as type-5 */ + if (is_host_route(&rn->p)) + continue; + build_type5_prefix_from_ip_prefix(&evp, &rn->p); ret = update_evpn_type5_route(bgp_vrf, &evp); if (ret) { diff --git a/lib/.prefix.h.swo b/lib/.prefix.h.swo deleted file mode 100644 index 51fe596fb3..0000000000 Binary files a/lib/.prefix.h.swo and /dev/null differ diff --git a/lib/prefix.h b/lib/prefix.h index aa857f330c..7408c75e11 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -399,4 +399,13 @@ static inline int is_default_prefix(const struct prefix *p) return 0; } +static inline int is_host_route(struct prefix *p) +{ + if (p->family == AF_INET) + return (p->prefixlen == IPV4_MAX_BITLEN); + else if (p->family == AF_INET6) + return (p->prefixlen == IPV6_MAX_BITLEN); + return 0; +} + #endif /* _ZEBRA_PREFIX_H */