summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-03-30 02:43:53 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-03-30 02:43:53 +0000
commit606f5b783ba41f30a653dcd1cdeb7c42262741e6 (patch)
treedcd231421296a7bf9a0961603f206be9505d1bed /sys/netinet6
parent3cce29673e509737c9de72c84989642c9564e292 (diff)
fix constness of IN6_{IS,ARE}_xx macros to conform to RFC2553.
sync with kame.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 0c51ee6badc..feb971032f1 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: in6.h,v 1.21 2001/03/02 04:55:12 itojun Exp $ */
-/* $KAME: in6.h,v 1.81 2001/03/02 04:54:45 itojun Exp $ */
+/* $OpenBSD: in6.h,v 1.22 2001/03/30 02:43:52 itojun Exp $ */
+/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
*/
#ifndef __KAME_NETINET_IN_H_INCLUDED_
-#error "do not include netinet6/in6.h directly, include netinet/in.h"
+#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
#endif
#ifndef _NETINET6_IN6_H_
@@ -242,37 +242,37 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
* Unspecified
*/
#define IN6_IS_ADDR_UNSPECIFIED(a) \
- ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == 0))
+ ((*(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))
/*
* Loopback
*/
#define IN6_IS_ADDR_LOOPBACK(a) \
- ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == ntohl(1)))
+ ((*(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)))
/*
* IPv4 compatible
*/
#define IN6_IS_ADDR_V4COMPAT(a) \
- ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != ntohl(1)))
+ ((*(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)))
/*
* Mapped
*/
#define IN6_IS_ADDR_V4MAPPED(a) \
- ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
- (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
+ ((*(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)))
/*
* KAME Scope Values