Skip to content

Commit

Permalink
build - define struct in6_addr in arpa/inet.h
Browse files Browse the repository at this point in the history
* Use the same mechanic used for struct in_addr to define in6_addr in
  arpa/inet.h, conditionalizing the define in in6.h.

* This helps w/pkgsrc builds.
  • Loading branch information
Matthew Dillon committed Oct 25, 2010
1 parent c558eb1 commit e2bc926
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/arpa/inet.h
Expand Up @@ -88,6 +88,17 @@ struct in_addr {
#define _STRUCT_IN_ADDR_DECLARED
#endif

#ifndef _STRUCT_IN6_ADDR_DECLARED
struct in6_addr {
union {
uint8_t __u6_addr8[16];
uint16_t __u6_addr16[8];
uint32_t __u6_addr32[4];
} __u6_addr; /* 128-bit IP6 address */
};
#define _STRUCT_IN6_ADDR_DECLARED
#endif

/* XXX all new diversions!! argh!! */
#if __BSD_VISIBLE
#define inet_addr __inet_addr
Expand Down
3 changes: 3 additions & 0 deletions sys/netinet6/in6.h
Expand Up @@ -123,13 +123,16 @@ typedef __socklen_t socklen_t;
/*
* IPv6 address
*/
#ifndef _STRUCT_IN6_ADDR_DECLARED
struct in6_addr {
union {
uint8_t __u6_addr8[16];
uint16_t __u6_addr16[8];
uint32_t __u6_addr32[4];
} __u6_addr; /* 128-bit IP6 address */
};
#define _STRUCT_IN6_ADDR_DECLARED
#endif

#define s6_addr __u6_addr.__u6_addr8
#define _s6_addr16 __u6_addr.__u6_addr16 /* internal use */
Expand Down

0 comments on commit e2bc926

Please sign in to comment.