bgpd: only advertise valid subnet routes as evpn type-5 routes

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
This commit is contained in:
Mitesh Kanjariya 2017-11-05 17:11:43 -08:00
parent 6ee86383bb
commit 408b00c4d7
3 changed files with 16 additions and 0 deletions

View File

@ -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) {

Binary file not shown.

View File

@ -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 */