mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 02:46:37 +00:00
bgpd: only advertise valid subnet routes as evpn type-5 routes
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
This commit is contained in:
parent
6ee86383bb
commit
408b00c4d7
@ -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.
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user