Kong / openresty-patches

Moved to https://github.com/Kong/kong-build-tools
Apache License 2.0
14 stars 6 forks source link

fix(transparent) avoid redefinition of kernel ipv6 definitions #29

Closed thibaultcha closed 5 years ago

thibaultcha commented 6 years ago

The following errors occur when building on Debian 7:

docker: In file included from src/os/unix/ngx_linux_config.h:121:0,
    docker:                  from src/core/ngx_config.h:26,
    docker:                  from src/core/ngx_log.c:8:
    docker: /usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr'
    docker: In file included from src/os/unix/ngx_linux_config.h:45:0,
    docker:                  from src/core/ngx_config.h:26,
    docker:                  from src/core/ngx_log.c:8:
    docker: /usr/include/netinet/in.h:198:8: note: originally defined here
    docker: In file included from src/os/unix/ngx_linux_config.h:121:0,
    docker:                  from src/core/ngx_config.h:26,
    docker:                  from src/core/ngx_log.c:8:
    docker: /usr/include/linux/in6.h:46:8: error: redefinition of 'struct sockaddr_in6'
    docker: In file included from src/os/unix/ngx_linux_config.h:44:0,
    docker:                  from src/core/ngx_config.h:26,
    docker:                  from src/core/ngx_log.c:8:
    docker: /usr/include/x86_64-linux-gnu/sys/socket.h:92:17: note: originally defined here
    docker: In file included from src/os/unix/ngx_linux_config.h:121:0,
    docker:                  from src/core/ngx_config.h:26,

We must include linux/in6.h before netinet/in.h, since the latter maintains definition guards around the IPv6 kernel structures:

https://code.woboq.org/userspace/glibc/inet/netinet/in.h.html#209

thibaultcha commented 5 years ago

Do not merge for now.