From 1b3b3e34ecbc281a13d4ca0b99e891ee9c4d5cac Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 18 Jun 2009 14:32:44 +0200 Subject: Minor bugfixes. --- lib/ipv6.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ipv6.h b/lib/ipv6.h index 9193c4f1..9cec86e7 100644 --- a/lib/ipv6.h +++ b/lib/ipv6.h @@ -31,7 +31,11 @@ typedef struct ipv6_addr { #define IPA_NONE _MI(0,0,0,0) -#define ipa_equal(x,y) (!memcmp(&(x),&(y),sizeof(ip_addr))) +#define ipa_equal(x,y) ({ ip_addr _a=(x), _b=(y); \ + _I0(_a) == _I0(_b) && \ + _I1(_a) == _I1(_b) && \ + _I2(_a) == _I2(_b) && \ + _I3(_a) == _I3(_b); }) #define ipa_nonzero(x) ({ ip_addr _a=(x); (_I0(_a) || _I1(_a) || _I2(_a) || _I3(_a)); }) #define ipa_and(x,y) ({ ip_addr _a=(x), _b=(y); \ _MI(_I0(_a) & _I0(_b), \ -- cgit v1.2.3