diff --git a/ChangeLog b/ChangeLog index 04fef5eff..fff7f9c07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20000314 + - Include macro for IN6_IS_ADDR_V4MAPPED. Report from + peter@frontierflying.com + 20000311 - Detect RSAref - OpenBSD CVS change diff --git a/defines.h b/defines.h index 519ebbaa2..48e14fd25 100644 --- a/defines.h +++ b/defines.h @@ -3,9 +3,12 @@ /* Necessary headers */ -#include +#include /* For [u]intxx_t */ + #include /* For SHUT_XXXX */ +#include /* For IPv6 macros */ + #ifdef HAVE_SYS_BITYPES_H # include /* For u_intXX_t */ #endif @@ -234,6 +237,12 @@ typedef unsigned int size_t; # define __P(x) x #endif +#if !defined(IN6_IS_ADDR_V4MAPPED) +# define IN6_IS_ADDR_V4MAPPED(a) \ + ((((uint32_t *) (a))[0] == 0) && (((uint32_t *) (a))[1] == 0) && \ + (((uint32_t *) (a))[2] == htonl (0xffff))) +#endif /* !defined(IN6_IS_ADDR_V4MAPPED) */ + #if !defined(__GNUC__) || (__GNUC__ < 2) # define __attribute__(x) #endif /* !defined(__GNUC__) || (__GNUC__ < 2) */