]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: only advertise valid subnet routes as evpn type-5 routes
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Mon, 6 Nov 2017 01:11:43 +0000 (17:11 -0800)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Thu, 14 Dec 2017 18:57:08 +0000 (10:57 -0800)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_evpn.c
lib/.prefix.h.swo [deleted file]
lib/prefix.h

index 1921a9553e10c64b2335f45627d805e7174df816..682bdb0075832f4f4b0c1d068e85e145586c834f 100644 (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) {
diff --git a/lib/.prefix.h.swo b/lib/.prefix.h.swo
deleted file mode 100644 (file)
index 51fe596..0000000
Binary files a/lib/.prefix.h.swo and /dev/null differ
index aa857f330c91df33fc256d0c3396c30d92a74360..7408c75e115bf774af9cf1fc7d670731b1de92a3 100644 (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 */