mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 10:49:24 +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;
|
struct prefix_evpn evp;
|
||||||
char buf[PREFIX_STRLEN];
|
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);
|
build_type5_prefix_from_ip_prefix(&evp, &rn->p);
|
||||||
ret = update_evpn_type5_route(bgp_vrf, &evp);
|
ret = update_evpn_type5_route(bgp_vrf, &evp);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Binary file not shown.
@ -399,4 +399,13 @@ static inline int is_default_prefix(const struct prefix *p)
|
|||||||
return 0;
|
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 */
|
#endif /* _ZEBRA_PREFIX_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user