summaryrefslogtreecommitdiffstats
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-07-01 22:27:56 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-07-01 22:38:14 +0200
commite66b8e39428674632533bd950ef32fbfffebe682 (patch)
treebd39dddbf33400b4116fb2bff60d5058364fd791 /lib/prefix.h
parentlib: Allow using IPv4 (Class E) reserved block if enabled (diff)
downloadfrr-e66b8e39428674632533bd950ef32fbfffebe682.tar.xz
frr-e66b8e39428674632533bd950ef32fbfffebe682.zip
lib: Convert ipv4_martian to bool
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index 6c51186f5..3a768572c 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -526,14 +526,14 @@ static inline int ipv6_martian(const struct in6_addr *addr)
extern int macstr2prefix_evpn(const char *str, struct prefix_evpn *p);
/* NOTE: This routine expects the address argument in network byte order. */
-static inline int ipv4_martian(const struct in_addr *addr)
+static inline bool ipv4_martian(const struct in_addr *addr)
{
in_addr_t ip = ntohl(addr->s_addr);
if (IPV4_NET0(ip) || IPV4_NET127(ip) || !ipv4_unicast_valid(addr)) {
- return 1;
+ return true;
}
- return 0;
+ return false;
}
static inline bool is_default_prefix4(const struct prefix_ipv4 *p)