From patchwork Wed Feb 21 16:51:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 129102 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp828538ljc; Wed, 21 Feb 2018 08:51:46 -0800 (PST) X-Google-Smtp-Source: AH8x225jjRilZwi160rghm8FlhvMR7aoRfwEYF97uHvIs2UdYCd4ZwwR3iVuEWArwnB58nqkWW0G X-Received: by 10.101.77.69 with SMTP id j5mr3233685pgt.352.1519231906135; Wed, 21 Feb 2018 08:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519231906; cv=none; d=google.com; s=arc-20160816; b=UBz1eVGGaf0qZkrPCqBoSaW3x/DAfF3mzNnd4v9lDfw+sZxe2X29x+LaCyNTuZ9VZ7 d6RfMStRq2x6xpZ1RSKpgRDQdOFdZufQWbSjYTLK8ZICA8r6KWOT6MFLn2qjkROBpbzG 0VwD9jvJqsw97kptdlzqH3u7LfBZDPqSXkAijIlc3UNqukNKzbvSshJSkY92i8k14E4V h4rSn/gC1d/FcPqLtA9X6FUqTTBYJgx1xZG5a2jOh91VLcJpdD3e85MXmbZMCXgQIsKP 73qoI5LnxQ0GxdaxnkHQqOkiQ62/Z3XKizLg7xDGVHTXVkpKb/INrUBQjGAPt0dO6+fk z/Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SWihVnGlC9SsEMZg5ueiaptoeRS4NUvARnUTjWUi7Zg=; b=YxIYYnhEuw49rQXYrzrtuPcL8FxwvQv+bYEi5i6ikWSdMJmzsfZ6gEOBjcPqnPec+D 4iosijSX94xZcG5iSCkIxrq1nsQwGEabqZsRYZldDYvW5QJf6y/s3qUcKqIcudzfaFXQ 4H2N1K2v5hFe+4wewvCUyu+JgyZxLtYXAO3xLcR+r0Q+91zBdWPSKvGn++rLzZDo+JlK r7oCPeK8Pvjm1cbyCBrDbj1FC0P7F5FDPH4vuw0AnlHci5cnIcvZ9hx4Bjsuttv22V2b gHjj91hNdxQH1pT1e9M1+9bx3/Hb2BPH/cIRPt1j9wt+fgpzwbSYdT3FpI7/vL7oQE7r JH7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CeG76KBV; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p27-v6si1627741pli.328.2018.02.21.08.51.45; Wed, 21 Feb 2018 08:51:46 -0800 (PST) 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=@linaro.org header.s=google header.b=CeG76KBV; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753508AbeBUQvn (ORCPT + 28 others); Wed, 21 Feb 2018 11:51:43 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33682 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753555AbeBUQvk (ORCPT ); Wed, 21 Feb 2018 11:51:40 -0500 Received: by mail-lf0-f65.google.com with SMTP id o145so82565lff.0 for ; Wed, 21 Feb 2018 08:51:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SWihVnGlC9SsEMZg5ueiaptoeRS4NUvARnUTjWUi7Zg=; b=CeG76KBV0WUVAbXcmBSv+qmdEHTxEtWKAU5LcEROI/QTqTt/rRbsxL96c7YgDb74w/ V5zhtRbUfNEhQ9+5t6JQCy5c0q1ceQrLQ6K72m9RkZesI/EFeEQK+0FOo3kWHFrS45XY 0gi8fmhStLtvwWkxAcl/8BUT4q3sf0Vw/ySUQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SWihVnGlC9SsEMZg5ueiaptoeRS4NUvARnUTjWUi7Zg=; b=gFlDH8mmgh6TKU3cLfPA4/BkOhYvV6Mvw9wVyVnH+KP0SPtrgjkcpzLYLwXfLjM57R SKBx1jytvdFYiRbyrfisTalJ+eBRjcVOSJ5fGu1BeX9vWrXe2s169SVXTXwDJt0+Agki G/zDwV0pmgbDuivdDd1FU3K0IPenj0MXgIE1r8G1JvulsXA0aMkltOMgxeNKojenoKbk 39UmEOXLIiBVKr6CUtVMhFLEJPg0CJEsHgChELHkZhj+caGCUCy6+azyhL5390Qvlkg9 WTyoUYSG/iz8uSSIdcY+qe16xj04gfjXzr1c7E94ajC53y2emxa7eGMyRDYw3h39Jf3W dutg== X-Gm-Message-State: APf1xPCV8woJEqMP4N1ZQNSaRlOHVjWONB1+xpg3wg8QqsC0orKq7O1F u5Gp6gU3wXemzB4R22X89pRlMv3iHbU= X-Received: by 10.46.13.10 with SMTP id 10mr3037508ljn.8.1519231898660; Wed, 21 Feb 2018 08:51:38 -0800 (PST) Received: from localhost (c-2c3d70d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.61.44]) by smtp.gmail.com with ESMTPSA id o77sm1421211lja.43.2018.02.21.08.51.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 08:51:37 -0800 (PST) From: Anders Roxell To: shuah@kernel.org Cc: daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Anders Roxell Subject: [PATCH] selftests/bpf: tcpbpf_kern: use in6_* macros from glibc Date: Wed, 21 Feb 2018 17:51:16 +0100 Message-Id: <20180221165116.9754-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both glibc and the kernel have in6_* macros definitions. Build fails because it picks up wrong in6_* macro from the kernel header and not the header from glibc. Fixes build error below: clang -I. -I./include/uapi -I../../../include/uapi -Wno-compare-distinct-pointer-types \ -O2 -target bpf -emit-llvm -c test_tcpbpf_kern.c -o - | \ llc -march=bpf -mcpu=generic -filetype=obj -o .../tools/testing/selftests/bpf/test_tcpbpf_kern.o In file included from test_tcpbpf_kern.c:12: .../netinet/in.h:101:5: error: expected identifier IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ ^ .../linux/in6.h:131:26: note: expanded from macro 'IPPROTO_HOPOPTS' ^ In file included from test_tcpbpf_kern.c:12: /usr/include/netinet/in.h:103:5: error: expected identifier IPPROTO_ROUTING = 43, /* IPv6 routing header. */ ^ .../linux/in6.h:132:26: note: expanded from macro 'IPPROTO_ROUTING' ^ In file included from test_tcpbpf_kern.c:12: .../netinet/in.h:105:5: error: expected identifier IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ ^ Since both glibc and the kernel have in6_* macros definitions, use the one from glibc. Kernel headers will check for previous libc definitions by including include/linux/libc-compat.h. Reported-by: Daniel Díaz Signed-off-by: Anders Roxell --- tools/testing/selftests/bpf/test_tcpbpf_kern.c | 1 - 1 file changed, 1 deletion(-) -- 2.11.0 Tested-by: Daniel Díaz diff --git a/tools/testing/selftests/bpf/test_tcpbpf_kern.c b/tools/testing/selftests/bpf/test_tcpbpf_kern.c index 57119ad57a3f..3e645ee41ed5 100644 --- a/tools/testing/selftests/bpf/test_tcpbpf_kern.c +++ b/tools/testing/selftests/bpf/test_tcpbpf_kern.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include