Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp897710yba; Thu, 18 Apr 2019 11:24:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4kGPEPSZBOwDPzivrn2O0kSzNUAlZVYh9TNbp3bGIlmRXhUbWpnkqkSwvrCjIrzSVymea X-Received: by 2002:a63:2c4a:: with SMTP id s71mr84819203pgs.373.1555611888737; Thu, 18 Apr 2019 11:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611888; cv=none; d=google.com; s=arc-20160816; b=g8ByzL7pmKh/xJBFTvy5neBXO5Yig7cHyr4ahgDXCcKlkjKFKWMI00lBBZm9N3K2bx 72Onrr8YiaxL+8yR+ZGuD2IfLk1b7vuXC0dkPZ5IJcWQam9H/awggOs7oVV3zqE+SO8a 1x8fq7YT+zm9Vkfi65OZBZTsPeoj1mddULHVs506GZgXMS/A6kbf/eFYBE0Hj2pvkQRA jv9EoFMibNdZBL4wU6yb/zQXm1i0vp5fMClkgjF5XOlNHXXhIlsPGiYRyo/GvIWIeEPm nRJAMdpa6bMYv7mFONMxfFjeiav23/3Xk35h/IWVhzn7U03pJvVT59KYkpaSuYq1wO1Y FnGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vYr4TTvTItyCC0XodL84g9xeo3aF20lLGRsMcAPXUEg=; b=L76MX9jFkGmL6CG37/jSK8wOXu8HQ0t+rEvLkcFKx9C10ubA46UtTEMImddPviF0hr LwfSNcRWSgmI+OwlB6hYkYz817WhlSSOlhPYAM1ibp68bhn6dh6BuQOL79LoFWNWYxgF h3PF3jpmopPHyGM1SpD6/sFA5wTQn9EiMqa2q609LZdN7SA+63roye0a4rdhIpJNmlTp mVO5QqzJF6trVNL/iNEA2tTfCUStPk4gw6inssTMuKYMB4NutfPqVLim8e48+Rr0CstU cB0Tjfd+RTTa0x+Yw3uv3tz0lJQ2Tyoeg1v673+6F/gZ549OH6TTc7NrvDgrobN/a0Ae wskg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IBpmXphy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t16si2403134pgi.518.2019.04.18.11.24.33; Thu, 18 Apr 2019 11:24:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IBpmXphy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391398AbfDRSW6 (ORCPT + 99 others); Thu, 18 Apr 2019 14:22:58 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34828 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391518AbfDRSGm (ORCPT ); Thu, 18 Apr 2019 14:06:42 -0400 Received: by mail-pf1-f193.google.com with SMTP id t21so1468914pfh.2; Thu, 18 Apr 2019 11:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=vYr4TTvTItyCC0XodL84g9xeo3aF20lLGRsMcAPXUEg=; b=IBpmXphyb71eJuHKD53RamnFK71RtaRfk+lvNZ4VwpLouZ5Iz6gfW2yNpaCJicBE7f zwAOsGPnlWCEXubP3ZmXazWaDcq9sIM1qR/ZfDeMIAfjs+8z2fJB8rC68qLLVG3bO2XM rf6ROlmnQgyafTFQnmcBtfFEs7tNC7K55RAHR5x7HBYDcTpNhJkJHdOoebGB7Rth9w3f eS07cYzdNbe8lfvL3Bw9aU52pAKINP1DSnh7+jovfuMyH9MqOiB722Ow9zVbGDYN2r7q dyGsMnyJk5l92GaYARUYclcXnNjezuwnoKqinqhRuFhnS1Agv4sIOAW60bO9z7+jvQRY IStg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=vYr4TTvTItyCC0XodL84g9xeo3aF20lLGRsMcAPXUEg=; b=gbg24NCP9xayOkagZps1B+YOdj/HgTLhNLyv1SpNz6nRfBlMd6/tRWPbV4G0iDAyak wl9oRMLc6iu+ZMEMLYF/yUsLIVz1bwTUKXNFvTpiKcwve1UKIU/5N5y+SKQCgmrztF5H D+xz+q58fYwc6RtPYRqd6Hbj8sh8H+w3N1mMo/f+euFIhSFUKU51vqr1YIInZaP6SJeC +uchO2KL3mNN3+KPdRY1vDz+npZCHG5Pj1J9uA7/vd8UYvd/mUEDF9KBej5+sq76v711 vc9wz3x5sKZ8JUdhezcyGqmfb7l/3nI5EzEh9CmFk6l1Qk/RKHQxg+amTgFZ5ME0Eoy7 iR5Q== X-Gm-Message-State: APjAAAVU7MT+Gb6fFx6CdYgh1iVkhg+v9NPisy0ZFQXI7j5wFkezpqR8 rgWYkHfhWYwDoPwgi2Aul+ZLk7Uk X-Received: by 2002:aa7:96c6:: with SMTP id h6mr7585608pfq.239.1555610801860; Thu, 18 Apr 2019 11:06:41 -0700 (PDT) Received: from udknight.localhost ([59.57.228.71]) by smtp.gmail.com with ESMTPSA id k1sm5172670pfc.83.2019.04.18.11.06.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 11:06:40 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.4) with ESMTP id x3II5EOV004878; Fri, 19 Apr 2019 02:05:14 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id x3II5D4W004875; Fri, 19 Apr 2019 02:05:13 +0800 Date: Fri, 19 Apr 2019 02:05:13 +0800 From: Wang YanQing To: ast@kernel.org Cc: daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, shuah@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] fix compile errors due to unsync linux/in6.h and netinet/in.h Message-ID: <20190418180513.GA4863@udknight> Mail-Followup-To: Wang YanQing , ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, shuah@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I meet below compile errors: " In file included from test_tcpnotify_kern.c:12: /usr/include/netinet/in.h:101:5: error: expected identifier IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ ^ /usr/include/linux/in6.h:131:26: note: expanded from macro 'IPPROTO_HOPOPTS' ^ In file included from test_tcpnotify_kern.c:12: /usr/include/netinet/in.h:103:5: error: expected identifier IPPROTO_ROUTING = 43, /* IPv6 routing header. */ ^ /usr/include/linux/in6.h:132:26: note: expanded from macro 'IPPROTO_ROUTING' ^ In file included from test_tcpnotify_kern.c:12: /usr/include/netinet/in.h:105:5: error: expected identifier IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ ^ /usr/include/linux/in6.h:133:26: note: expanded from macro 'IPPROTO_FRAGMENT' " The same compile errors are reported for test_tcpbpf_kern.c too. My environment: lsb_release -a: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial dpkg -l | grep libc-dev: ii libc-dev-bin 2.23-0ubuntu11 amd64 GNU C Library: Development binaries ii linux-libc-dev:amd64 4.4.0-145.171 amd64 Linux Kernel Headers for development. The reason is linux/in6.h and netinet/in.h aren't synchronous about how to handle the same definitions, IPPROTO_HOPOPTS, etc. This patch fixes the compile errors by moving to before the . Signed-off-by: Wang YanQing --- Changes v1-v2: 1:Rewrite the changelog. tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c | 2 +- tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c b/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c index 74f73b3..c7c3240 100644 --- a/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c +++ b/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include @@ -9,7 +10,6 @@ #include #include #include -#include #include "bpf_helpers.h" #include "bpf_endian.h" #include "test_tcpbpf.h" diff --git a/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c b/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c index edbca20..ec6db6e 100644 --- a/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c +++ b/tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include @@ -9,7 +10,6 @@ #include #include #include -#include #include "bpf_helpers.h" #include "bpf_endian.h" #include "test_tcpnotify.h" -- 1.8.5.6.2.g3d8a54e.dirty