Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
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) {
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 */