summaryrefslogtreecommitdiff
path: root/sbin/iked/iked.h
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2011-01-21 17:01:34 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2011-01-21 17:01:34 +0000
commit81825332e44d97e53bb95b2c47b591a9cc30c793 (patch)
tree08d1fbc6508b6d4633db33d5a3ca88e674ce5c74 /sbin/iked/iked.h
parent88b26796733b779680726bd87d83d0627aa5a263 (diff)
don't use memcmp on comparing two iked_addrs but IKED_ADDR_EQ.
ok mikeb@
Diffstat (limited to 'sbin/iked/iked.h')
-rw-r--r--sbin/iked/iked.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h
index cc659f997b2..0078045943e 100644
--- a/sbin/iked/iked.h
+++ b/sbin/iked/iked.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.h,v 1.32 2011/01/21 16:51:38 reyk Exp $ */
+/* $OpenBSD: iked.h,v 1.33 2011/01/21 17:01:33 reyk Exp $ */
/* $vantronix: iked.h,v 1.61 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -62,6 +62,11 @@ struct imsgev {
} while (0)
#define IMSG_DATA_SIZE(imsg) ((imsg)->hdr.len - IMSG_HEADER_SIZE)
+#define IKED_ADDR_EQ(_a, _b) \
+ ((_a)->addr_mask == (_b)->addr_mask && \
+ sockaddr_cmp((struct sockaddr *)&(_a)->addr, \
+ (struct sockaddr *)&(_b)->addr, (_a)->addr_mask) == 0)
+
#define IKED_ADDR_NEQ(_a, _b) \
((_a)->addr_mask != (_b)->addr_mask || \
sockaddr_cmp((struct sockaddr *)&(_a)->addr, \