summaryrefslogtreecommitdiff
path: root/lib/ipaddr.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipaddr.h')
-rw-r--r--lib/ipaddr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ipaddr.h b/lib/ipaddr.h
index ec08fc09a2..6bd614044c 100644
--- a/lib/ipaddr.h
+++ b/lib/ipaddr.h
@@ -119,6 +119,12 @@ static inline void ipv4_mapped_ipv6_to_ipv4(struct in6_addr *in6,
memcpy(in, (char *)in6 + 12, sizeof(struct in_addr));
}
+static inline bool ipaddr_isset(struct ipaddr *ip)
+{
+ static struct ipaddr a = {};
+ return (0 == memcmp(&a, ip, sizeof(struct ipaddr)));
+}
+
#ifdef __cplusplus
}
#endif