23 Aug, 2016

1 commit

  • Fixes these compiler warnings via libc-compat.h when glibc netipx/ipx.h is
    included before linux/ipx.h:

    ./linux/ipx.h:9:8: error: redefinition of ‘struct sockaddr_ipx’
    ./linux/ipx.h:26:8: error: redefinition of ‘struct ipx_route_definition’
    ./linux/ipx.h:32:8: error: redefinition of ‘struct ipx_interface_definition’
    ./linux/ipx.h:49:8: error: redefinition of ‘struct ipx_config_data’
    ./linux/ipx.h:58:8: error: redefinition of ‘struct ipx_route_def’

    Signed-off-by: Mikko Rapeli
    Signed-off-by: David S. Miller

    Mikko Rapeli
     

21 May, 2016

1 commit

  • These structures are defined only if __USE_MISC is set in glibc net/if.h
    headers, ie when _BSD_SOURCE or _SVID_SOURCE are defined.

    CC: Jan Engelhardt
    CC: Josh Boyer
    CC: Stephen Hemminger
    CC: Waldemar Brodkorb
    CC: Gabriel Laskar
    CC: Mikko Rapeli
    Fixes: 4a91cb61bb99 ("uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h")
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

10 May, 2016

1 commit

  • glibc's net/if.h contains copies of definitions from linux/if.h and these
    conflict and cause build failures if both files are included by application
    source code. Changes in uapi headers, which fixed header file dependencies to
    include linux/if.h when it was needed, e.g. commit 1ffad83d, made the
    net/if.h and linux/if.h incompatibilities visible as build failures for
    userspace applications like iproute2 and xtables-addons.

    This patch fixes compile errors when glibc net/if.h is included before
    linux/if.h:

    ./linux/if.h:99:21: error: redeclaration of enumerator ‘IFF_NOARP’
    ./linux/if.h:98:23: error: redeclaration of enumerator ‘IFF_RUNNING’
    ./linux/if.h:97:26: error: redeclaration of enumerator ‘IFF_NOTRAILERS’
    ./linux/if.h:96:27: error: redeclaration of enumerator ‘IFF_POINTOPOINT’
    ./linux/if.h:95:24: error: redeclaration of enumerator ‘IFF_LOOPBACK’
    ./linux/if.h:94:21: error: redeclaration of enumerator ‘IFF_DEBUG’
    ./linux/if.h:93:25: error: redeclaration of enumerator ‘IFF_BROADCAST’
    ./linux/if.h:92:19: error: redeclaration of enumerator ‘IFF_UP’
    ./linux/if.h:252:8: error: redefinition of ‘struct ifconf’
    ./linux/if.h:203:8: error: redefinition of ‘struct ifreq’
    ./linux/if.h:169:8: error: redefinition of ‘struct ifmap’
    ./linux/if.h:107:23: error: redeclaration of enumerator ‘IFF_DYNAMIC’
    ./linux/if.h:106:25: error: redeclaration of enumerator ‘IFF_AUTOMEDIA’
    ./linux/if.h:105:23: error: redeclaration of enumerator ‘IFF_PORTSEL’
    ./linux/if.h:104:25: error: redeclaration of enumerator ‘IFF_MULTICAST’
    ./linux/if.h:103:21: error: redeclaration of enumerator ‘IFF_SLAVE’
    ./linux/if.h:102:22: error: redeclaration of enumerator ‘IFF_MASTER’
    ./linux/if.h:101:24: error: redeclaration of enumerator ‘IFF_ALLMULTI’
    ./linux/if.h:100:23: error: redeclaration of enumerator ‘IFF_PROMISC’

    The cases where linux/if.h is included before net/if.h need a similar fix in
    the glibc side, or the order of include files can be changed userspace
    code as a workaround.

    This change was tested in x86 userspace on Debian unstable with
    scripts/headers_compile_test.sh:

    $ make headers_install && \
    cd usr/include && ../../scripts/headers_compile_test.sh -l -k
    ...
    cc -Wall -c -nostdinc -I /usr/lib/gcc/i586-linux-gnu/5/include -I /usr/lib/gcc/i586-linux-gnu/5/include-fixed -I . -I /home/mcfrisk/src/linux-2.6/usr/headers_compile_test_include.2uX2zH -I /home/mcfrisk/src/linux-2.6/usr/headers_compile_test_include.2uX2zH/i586-linux-gnu -o /dev/null ./linux/if.h_libc_before_kernel.h
    PASSED libc before kernel test: ./linux/if.h

    Reported-by: Jan Engelhardt
    Reported-by: Josh Boyer
    Reported-by: Stephen Hemminger
    Reported-by: Waldemar Brodkorb
    Cc: Gabriel Laskar
    Signed-off-by: Mikko Rapeli
    Signed-off-by: David S. Miller

    Mikko Rapeli
     

30 Jun, 2015

1 commit

  • u
    This fixes breakage to iproute2 build with recent kernel headers
    caused by:
    commit a263653ed798216c0069922d7b5237ca49436007
    Author: Pablo Neira Ayuso
    Date: Wed Jun 17 10:28:27 2015 -0500

    netfilter: don't pull include/linux/netfilter.h from netns headers

    The issue is that definitions in linux/in.h overlap with those
    in netinet/in.h. This patch solves this by introducing the same
    mechanism as was used to solve the same problem with linux/in6.h

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

09 Jan, 2015

1 commit

  • Both netinet/in.h and linux/ipv6.h define these two structs,
    if we include both of them, we got:

    /usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’
    struct in6_pktinfo {
    ^
    In file included from /usr/include/arpa/inet.h:22:0,
    from txtimestamp.c:33:
    /usr/include/netinet/in.h:524:8: note: originally defined here
    struct in6_pktinfo
    ^
    In file included from txtimestamp.c:40:0:
    /usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’
    struct ip6_mtuinfo {
    ^
    In file included from /usr/include/arpa/inet.h:22:0,
    from txtimestamp.c:33:
    /usr/include/netinet/in.h:531:8: note: originally defined here
    struct ip6_mtuinfo
    ^
    So similarly to what we did for in6_addr, we need to sync with
    libc header on their definitions.

    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    WANG Cong
     

23 Dec, 2014

1 commit

  • Resolve conflicts between glibc definition of IPV6 socket options
    and those defined in Linux headers. Looks like earlier efforts to
    solve this did not cover all the definitions.

    It resolves warnings during iproute2 build.
    Please consider for stable as well.

    Signed-off-by: Stephen Hemminger
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    stephen hemminger
     

04 Apr, 2014

1 commit

  • If the glibc xattr.h header is included after the uapi header,
    compilation fails due to an enum re-using a #define from the uapi
    header.

    Protect against this by guarding the define and enum inclusions against
    each other.

    (See https://lists.debian.org/debian-glibc/2014/03/msg00029.html
    and https://sourceware.org/glibc/wiki/Synchronizing_Headers
    for more information.)

    Signed-off-by: Serge Hallyn
    Cc: Andrew Morton
    Cc: Allan McRae
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge Hallyn
     

05 Sep, 2013

1 commit

  • Solution:
    =========

    - Synchronize linux's `include/uapi/linux/in6.h'
    with glibc's `inet/netinet/in.h'.
    - Synchronize glibc's `inet/netinet/in.h with linux's
    `include/uapi/linux/in6.h'.
    - Allow including the headers in either other.
    - First header included defines the structures and macros.

    Details:
    ========

    The kernel promises not to break the UAPI ABI so I don't
    see why we can't just have the two userspace headers
    coordinate?

    If you include the kernel headers first you get those,
    and if you include the glibc headers first you get those,
    and the following patch arranges a coordination and
    synchronization between the two.

    Let's handle `include/uapi/linux/in6.h' from linux,
    and `inet/netinet/in.h' from glibc and ensure they compile
    in any order and preserve the required ABI.

    These two patches pass the following compile tests:

    cat >> test1.c <> test2.c <
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Carlos O'Donell