summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-01-26 12:04:19 +0000
committerglebius <glebius@FreeBSD.org>2012-01-26 12:04:19 +0000
commitb1246dbed62e4adcd937e2c1cfbcfc1bfddd9487 (patch)
tree8fb83450113dd12468cc374f390717410bfd86f0 /sys/netinet6/in6.h
parent7900947bc5753da4e1cd11c973f438b5b58721ea (diff)
downloadFreeBSD-src-b1246dbed62e4adcd937e2c1cfbcfc1bfddd9487.zip
FreeBSD-src-b1246dbed62e4adcd937e2c1cfbcfc1bfddd9487.tar.gz
Remove casts from inet6 address testing macros, thus preserving
qualifier from original argument. Obtained from: NetBSD, r. 1.67 Submitted by: maxim
Diffstat (limited to 'sys/netinet6/in6.h')
-rw-r--r--sys/netinet6/in6.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 2f986d4..f0cf4f4 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -235,37 +235,37 @@ extern const struct in6_addr in6addr_linklocal_allv2routers;
* Unspecified
*/
#define IN6_IS_ADDR_UNSPECIFIED(a) \
- ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
+ ((a)->__u6_addr.__u6_addr32[0] == 0 && \
+ (a)->__u6_addr.__u6_addr32[1] == 0 && \
+ (a)->__u6_addr.__u6_addr32[2] == 0 && \
+ (a)->__u6_addr.__u6_addr32[3] == 0)
/*
* Loopback
*/
#define IN6_IS_ADDR_LOOPBACK(a) \
- ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
+ ((a)->__u6_addr.__u6_addr32[0] == 0 && \
+ (a)->__u6_addr.__u6_addr32[1] == 0 && \
+ (a)->__u6_addr.__u6_addr32[2] == 0 && \
+ (a)->__u6_addr.__u6_addr32[3] == ntohl(1))
/*
* IPv4 compatible
*/
#define IN6_IS_ADDR_V4COMPAT(a) \
- ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
+ ((a)->__u6_addr.__u6_addr32[0] == 0 && \
+ (a)->__u6_addr.__u6_addr32[1] == 0 && \
+ (a)->__u6_addr.__u6_addr32[2] == 0 && \
+ (a)->__u6_addr.__u6_addr32[3] != 0 && \
+ (a)->__u6_addr.__u6_addr32[3] != ntohl(1))
/*
* Mapped
*/
#define IN6_IS_ADDR_V4MAPPED(a) \
- ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
+ ((a)->__u6_addr.__u6_addr32[0] == 0 && \
+ (a)->__u6_addr.__u6_addr32[1] == 0 && \
+ (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff))
/*
* KAME Scope Values
OpenPOWER on IntegriCloud