Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1125030rwe; Thu, 25 Aug 2022 16:18:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR7hPTpbCAXXxkag+ZNYKvyyPtHsJ1KdhXydVbDu1KWXv9Idt4vYoFx6BT82Nz/yCQcpFiGu X-Received: by 2002:a17:907:7632:b0:73d:c346:de57 with SMTP id jy18-20020a170907763200b0073dc346de57mr3881371ejc.647.1661469505318; Thu, 25 Aug 2022 16:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661469505; cv=none; d=google.com; s=arc-20160816; b=OSnJ+YKYK4V0MaJJT4t+Mg6PqTcTHOl1vGg9nykH/uCRWCC37SgFXbgfnDKU1fr7PS vvaA44D3qarogF7UzZh0/H7fbCpfSHj/ZLY+U6XePBccw5jTYAV8jqY2w/siTfGrEX0a 2Tk7pw1pCheq+4EoFuaa9oNdtdoIteXchxiYTpkacHAEVjiMabnkCKSwwQoALCwpFPPQ 6pJUhaAEWHPGPCT91CsHKSKzirqnlbbtd0DNkBcwY0vmVsJFcxtIdIwXPEAKjFrny00D yw62C4JxCtLPyJNwP2UuW6t77kPOHfKj5iy6ONpVxdqrGM5ZntCUUj8xR6j6NNhJhTjc 3jrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cgiyIbhlK0oTTb9MOi/TmiilB4y7xpSPs1MPQHO3WO0=; b=zvoFrGk34tVLkish/JgXHoj72J9EWxgVhULXsklq3Sd6MzJUaAcITB96T+cw7iLVsQ 648rS14lLCwe9MtO0JXa6kBSFH0+TmPOv1/RbVQELoq1KZ3xaKVRB9DLTm44Ti/qGm1k M5UXWwLwCQRwQJLqd/9PmiIwkYUYGevolS3gOf9DztrPha5EueXnbLvslGYFk+x8+Ann I4fKLQrsMCe7wNC2MpUWrNp0UUhDGS35cvUAvkZs7EyJns32HI4/yEdGk8TqkFDIRFMP McAR+YAZ5U4egoUrX8QIp7sUx1ePYz47IeYDucnhSuSNbZNIGr27RKmd/UBxTxWK9dtb e9Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="hHesMge/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq17-20020a1709073f1100b0073d847ef4f4si265394ejc.773.2022.08.25.16.17.58; Thu, 25 Aug 2022 16:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="hHesMge/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244106AbiHYWux (ORCPT + 99 others); Thu, 25 Aug 2022 18:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244066AbiHYWue (ORCPT ); Thu, 25 Aug 2022 18:50:34 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C444E63F for ; Thu, 25 Aug 2022 15:50:24 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id d71so19085452pgc.13 for ; Thu, 25 Aug 2022 15:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=cgiyIbhlK0oTTb9MOi/TmiilB4y7xpSPs1MPQHO3WO0=; b=hHesMge/GsZDFgpbHiRU1/UfdcLKj9rRgWjPmiami37jZ/cpClJZ6eI9QHYYYGDkCr HmTw03rCd/m3DAOTUGfGhB46uLB4m6KGI7tuAnar6oihXo08kVVgTMWhPEgt3Bcm8bj2 ZpV+/0uNCoYPnbj9kUhcXx3xWbm0W8xrwqZNF4tejv8+tw9miDtWQGw7eKM9CN24TPjq /HyFA4QNbJhzOcIzQgZWlTt9ux6uXvUjRVfwE/5FNCsTkIaVM54A6QO4heiRYgARc2DX bzFthjvMGuSWsk0iQETnoHp9yMhrHwGl6RuzO0tXr/jj7bJFzNgyrhmC3zKh8c6OhIr6 TRpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=cgiyIbhlK0oTTb9MOi/TmiilB4y7xpSPs1MPQHO3WO0=; b=O/Nfcx2j0D+Vvdm519MXt7viagzZ9hXNcnqtswsY/uUUdZvR6mOpBtAH2fIkwG+u8b 7rv1XrTE3CtPy8a9JEdXcFMJHAFl6Ced4ol5eDBdVZkA1MyATAdNrQlYtXYKszocEY8P LYkT+jLXNVKMnAXvnnrojSrU/izqDDjQW62Z12H2B/T2JKf63QSk1hluOjRSv6Gtrjox vkw5XikT9+5WAdqfp1psmFqjtD3tGNoTvclAPD8TqWh8OMW6neGoWNDHmCS+KfM5FZLE YPFKq3yAwDqXkJeVTS1izPvdo7CWKbpWKxntjMcZybjzJHr22v44tvJIlOyNdYCjf+rp payQ== X-Gm-Message-State: ACgBeo1NGo/10CNAHBzBkaGJoBmKpijhz8B64gc5GZ5+UNHYvtn9U/xz QyD6K7DyUJ4ik8m8NnHCcWNQdB/JLxt3aSr193pcmg== X-Received: by 2002:a65:6953:0:b0:42a:4612:2d7b with SMTP id w19-20020a656953000000b0042a46122d7bmr1022618pgq.253.1661467823820; Thu, 25 Aug 2022 15:50:23 -0700 (PDT) MIME-Version: 1.0 References: <20220825221751.258958-1-james.hilliard1@gmail.com> In-Reply-To: <20220825221751.258958-1-james.hilliard1@gmail.com> From: Stanislav Fomichev Date: Thu, 25 Aug 2022 15:50:12 -0700 Message-ID: Subject: Re: [PATCH] selftests/bpf: Fix bind{4,6} tcp/socket header type conflict To: James Hilliard Cc: bpf@vger.kernel.org, Andrii Nakryiko , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2022 at 3:18 PM James Hilliard wrote: > > There is a potential for us to hit a type conflict when including > netinet/tcp.h with sys/socket.h, we can replace both of these includes > with linux/tcp.h to avoid this conflict. > > Fixes errors like: > In file included from /usr/include/netinet/tcp.h:91, > from progs/bind4_prog.c:10: > /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:34:23: error: conflicting types for 'int8_t'; have 'char' > 34 | typedef __INT8_TYPE__ int8_t; > | ^~~~~~ > In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, > from /usr/include/x86_64-linux-gnu/bits/socket.h:29, > from /usr/include/x86_64-linux-gnu/sys/socket.h:33, > from progs/bind4_prog.c:9: > /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:18: note: previous declaration of 'int8_t' with type 'int8_t' {aka 'signed char'} > 24 | typedef __int8_t int8_t; > | ^~~~~~ > /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:43:24: error: conflicting types for 'int64_t'; have 'long int' > 43 | typedef __INT64_TYPE__ int64_t; > | ^~~~~~~ > /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: note: previous declaration of 'int64_t' with type 'int64_t' {aka 'long long int'} > 27 | typedef __int64_t int64_t; > | ^~~~~~~ > make: *** [Makefile:537: /home/buildroot/bpf-next/tools/testing/selftests/bpf/bpf_gcc/bind4_prog.o] Error 1 > > Signed-off-by: James Hilliard Still compiles in my environment: Reviewed-by: Stanislav Fomichev Not sure we want it for the tests, but just in case: Fixes: a999696c547f ("selftests/bpf: Rewrite test_sock_addr bind bpf into C") > --- > tools/testing/selftests/bpf/progs/bind4_prog.c | 3 +-- > tools/testing/selftests/bpf/progs/bind6_prog.c | 3 +-- > 2 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/bpf/progs/bind4_prog.c b/tools/testing/selftests/bpf/progs/bind4_prog.c > index 474c6a62078a..6bd20042fd53 100644 > --- a/tools/testing/selftests/bpf/progs/bind4_prog.c > +++ b/tools/testing/selftests/bpf/progs/bind4_prog.c > @@ -6,8 +6,7 @@ > #include > #include > #include > -#include > -#include > +#include > #include > #include > > diff --git a/tools/testing/selftests/bpf/progs/bind6_prog.c b/tools/testing/selftests/bpf/progs/bind6_prog.c > index c19cfa869f30..f37617b35a55 100644 > --- a/tools/testing/selftests/bpf/progs/bind6_prog.c > +++ b/tools/testing/selftests/bpf/progs/bind6_prog.c > @@ -6,8 +6,7 @@ > #include > #include > #include > -#include > -#include > +#include > #include > #include > > -- > 2.34.1 >