diff mbox series

[bpf-next,v1,18/19] selftests/bpf: Fix errors compiling crypto_sanity.c with musl libc

Message ID 911293968f424ad7b462d8805aeb3baee8f4985b.1721713597.git.tony.ambardar@gmail.com (mailing list archive)
State New
Headers show
Series selftests/bpf: Improve libc portability / musl support (part 1) | expand

Commit Message

Tony Ambardar July 23, 2024, 5:54 a.m. UTC
Remove a redundant include of '<linux/in6.h>', whose needed definitions are
already provided by 'test_progs.h'. This avoids errors seen compiling for
mips64el/musl-libc:

  In file included from .../arpa/inet.h:9,
                   from ./test_progs.h:17,
                   from prog_tests/crypto_sanity.c:10:
  .../netinet/in.h:23:8: error: redefinition of 'struct in6_addr'
     23 | struct in6_addr {
        |        ^~~~~~~~
  In file included from crypto_sanity.c:7:
  .../linux/in6.h:33:8: note: originally defined here
     33 | struct in6_addr {
        |        ^~~~~~~~
  .../netinet/in.h:34:8: error: redefinition of 'struct sockaddr_in6'
     34 | struct sockaddr_in6 {
        |        ^~~~~~~~~~~~
  .../linux/in6.h:50:8: note: originally defined here
     50 | struct sockaddr_in6 {
        |        ^~~~~~~~~~~~
  .../netinet/in.h:42:8: error: redefinition of 'struct ipv6_mreq'
     42 | struct ipv6_mreq {
        |        ^~~~~~~~~
  .../linux/in6.h:60:8: note: originally defined here
     60 | struct ipv6_mreq {
        |        ^~~~~~~~~

Fixes: 91541ab192fc ("selftests: bpf: crypto skcipher algo selftests")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/prog_tests/crypto_sanity.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Vadim Fedorenko July 23, 2024, 9:55 a.m. UTC | #1
On 23/07/2024 06:54, Tony Ambardar wrote:
> Remove a redundant include of '<linux/in6.h>', whose needed definitions are
> already provided by 'test_progs.h'. This avoids errors seen compiling for
> mips64el/musl-libc:
> 
>    In file included from .../arpa/inet.h:9,
>                     from ./test_progs.h:17,
>                     from prog_tests/crypto_sanity.c:10:
>    .../netinet/in.h:23:8: error: redefinition of 'struct in6_addr'
>       23 | struct in6_addr {
>          |        ^~~~~~~~
>    In file included from crypto_sanity.c:7:
>    .../linux/in6.h:33:8: note: originally defined here
>       33 | struct in6_addr {
>          |        ^~~~~~~~
>    .../netinet/in.h:34:8: error: redefinition of 'struct sockaddr_in6'
>       34 | struct sockaddr_in6 {
>          |        ^~~~~~~~~~~~
>    .../linux/in6.h:50:8: note: originally defined here
>       50 | struct sockaddr_in6 {
>          |        ^~~~~~~~~~~~
>    .../netinet/in.h:42:8: error: redefinition of 'struct ipv6_mreq'
>       42 | struct ipv6_mreq {
>          |        ^~~~~~~~~
>    .../linux/in6.h:60:8: note: originally defined here
>       60 | struct ipv6_mreq {
>          |        ^~~~~~~~~
> 
> Fixes: 91541ab192fc ("selftests: bpf: crypto skcipher algo selftests")
> Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
> ---
>   tools/testing/selftests/bpf/prog_tests/crypto_sanity.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c b/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
> index b1a3a49a822a..42bd07f7218d 100644
> --- a/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
> +++ b/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
> @@ -4,7 +4,6 @@
>   #include <sys/types.h>
>   #include <sys/socket.h>
>   #include <net/if.h>
> -#include <linux/in6.h>
>   #include <linux/if_alg.h>
>   
>   #include "test_progs.h"

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c b/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
index b1a3a49a822a..42bd07f7218d 100644
--- a/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
+++ b/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
@@ -4,7 +4,6 @@ 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#include <linux/in6.h>
 #include <linux/if_alg.h>
 
 #include "test_progs.h"