[openssl-dev] [openssl.org #4480] Ubuntu 14 (x86_64): Compile errors and warnings when using "no-asm -ansi"

Jeffrey Walton noloader at gmail.com
Fri Mar 25 17:33:12 UTC 2016

On Fri, Mar 25, 2016 at 1:00 PM, Richard Levitte via RT <rt at openssl.org> wrote:
> Vid Fre, 25 Mar 2016 kl. 10.29.39, skrev noloader at gmail.com:
>> -DOPENSSLDIR="\"/usr/local/ssl\""
>> -DENGINESDIR="\"/usr/local/lib/engines\"" -Wall -O3 -pthread -m64
>> -DL_ENDIAN -ansi -fPIC -Iinclude -I. -Icrypto/include -MMD -MF
>> crypto/bio/bss_dgram.d.tmp -MT crypto/bio/bss_dgram.o -c -o
>> crypto/bio/bss_dgram.o crypto/bio/bss_dgram.c
>> In file included from /usr/include/netdb.h:27:0,
>> from ./e_os.h:443,
>> from crypto/bio/bio_lcl.h:2,
>> from crypto/bio/bss_dgram.c:62:
>> crypto/bio/bss_dgram.c: In function ‘dgram_get_mtu_overhead’:
>> crypto/bio/bss_dgram.c:433:20: error: ‘const struct in6_addr’ has no
>> member named ‘s6_addr32’
>> && IN6_IS_ADDR_V4MAPPED(&tmp_addr))
>> ^
>> crypto/bio/bss_dgram.c:433:20: error: ‘const struct in6_addr’ has no
>> member named ‘s6_addr32’
> This is particularly disturbing... It suggests that the diverse network system
> headers have bugs under certain circumstances...

Yeah, I did not quite understand it either. I think its because ANSI,
POSIX, et al only require a 'struct in6_addr'. They don't require the
other members.

Looking at the two definitions of in6_addr showed both guarded the
additional members. The following is from a mostly GNU Linux machine

Here one (/usr/include/linux/in6.h):

struct in6_addr {
    union {
        __u8        u6_addr8[16];
        __be16      u6_addr16[8];
        __be32      u6_addr32[4];
    } in6_u;
#define s6_addr         in6_u.u6_addr8
#define s6_addr16       in6_u.u6_addr16
#define s6_addr32       in6_u.u6_addr32
#endif /* __UAPI_DEF_IN6_ADDR */

And here's the other (/usr/include/netinet/in.h):

/* IPv6 address */
struct in6_addr
    uint8_t __u6_addr8[16];
#ifdef __USE_MISC
    uint16_t __u6_addr16[8];
    uint32_t __u6_addr32[4];
      } __in6_u;
#define s6_addr         __in6_u.__u6_addr8
#ifdef __USE_MISC
# define s6_addr16      __in6_u.__u6_addr16
# define s6_addr32      __in6_u.__u6_addr32
#endif /* !__USE_KERNEL_IPV6_DEFS */


More information about the openssl-dev mailing list