summaryrefslogtreecommitdiff
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2017-11-05 17:11:43 -0800
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2017-12-14 10:57:08 -0800
commit408b00c4d73b1975e378ca512cb32c13f9e544d8 (patch)
treef0040f9b29588e749379508b9747f9c4436a78c5 /lib/prefix.h
parent6ee86383bb69a21c9bcb215d8e47ca2bb2e82a79 (diff)
bgpd: only advertise valid subnet routes as evpn type-5 routes
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index aa857f330c..7408c75e11 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -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 */