From 81825332e44d97e53bb95b2c47b591a9cc30c793 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Fri, 21 Jan 2011 17:01:34 +0000 Subject: don't use memcmp on comparing two iked_addrs but IKED_ADDR_EQ. ok mikeb@ --- sbin/iked/iked.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sbin/iked/iked.h') 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, \ -- cgit v1.2.3