summaryrefslogtreecommitdiffstats
path: root/lib/prefix.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index 7f0d3607..8c8992e8 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -196,4 +196,14 @@ extern const char *inet6_ntoa (struct in6_addr);
extern int all_digit (const char *);
+static inline int ipv4_martian (struct in_addr *addr)
+{
+ in_addr_t ip = addr->s_addr;
+
+ if (IPV4_NET0(ip) || IPV4_NET127(ip) || IPV4_CLASS_DE(ip)) {
+ return 1;
+ }
+ return 0;
+}
+
#endif /* _ZEBRA_PREFIX_H */