summaryrefslogtreecommitdiff
path: root/babeld/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'babeld/util.h')
-rw-r--r--babeld/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/babeld/util.h b/babeld/util.h
index 8535d4dd6a..ddc6a70d43 100644
--- a/babeld/util.h
+++ b/babeld/util.h
@@ -104,6 +104,12 @@ void uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src);
int daemonise(void);
extern const unsigned char v4prefix[16];
+static inline bool
+is_default(const unsigned char *prefix, int plen)
+{
+ return plen == 0 || (plen == 96 && v4mapped(prefix));
+}
+
/* If debugging is disabled, we want to avoid calling format_address
for every omitted debugging message. So debug is a macro. But
vararg macros are not portable. */