Received: by 10.223.185.116 with SMTP id b49csp1183188wrg; Wed, 21 Feb 2018 13:40:54 -0800 (PST) X-Google-Smtp-Source: AH8x227pfPECpFRs9Jn7eaTKQiOXfQisdqxaGW92dgFRmbICUWKMYO0XBuH2IyCE0QG/UVk0YPpv X-Received: by 10.98.219.129 with SMTP id f123mr4638200pfg.195.1519249254844; Wed, 21 Feb 2018 13:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519249254; cv=none; d=google.com; s=arc-20160816; b=kJCuOA3C0DmdBERGjmh2X3eLeVTADm15hyrSed5n4qHd8nj7+IDZZ8ElpD06G0Iby9 RRYuwx6+hIQtvY+/N1h6kn24lDYbwj58wUuHFxTAyZZnCEorrOPVXnScCdoQNpIqNAPw oVp2t39FOkk26W1SrMYNJ6cmEKzhbb2itfpzt+f8YksmpxorjzA3a1dt71Jx2b8fSm+W dAgg/t3GuRyEa3VDsCzvUNLr1fUbPPdeGAVVDXbCZtod3Ov6VrC9/gqp/zWmGXZWLm0e po/0MExdgU58qWBa58EpvjZQqtDE8yJ9UrrNueY+KK2ckBfuZ359ghit+SOiukeV+Ln0 4b0A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=XWAWTCZCO5DmV/Kc+x9O8BgKmqQiaZh4a8SEFOD/hI4=; b=A+kU2CtIq9eObepd3XMyH5yKq+rZPVsNqkZZE2R/ynqmvB2cwjY64Pqo90GJ2G2cgF vSyjDar08t2EvuKLMVDgev4HvSS4nE+uMq23sgmH1P8ijZwZNs0XJThOUpXj7zbrtOKr TjYQm7Qxk0ZvBlJIlNJA12YE43zH3DR3AWBLjJupoZ9BvJrM9MiHY+Yz3l/qrWaj8lXU an7/Xt4Q8mTucxf04EROlgaX+kMR1l98TP2XXXGm/Vpnz/ZdYv8ou8LpRrc5zzJZ3/gQ Eu4xn3ek2GFtU3Vcb23Zvd/1WU3/lU28V6+opUd5QeBk45aZDQNk/hto+X9ycbsNtsry vJ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oq1MZZM6; 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 d19-v6si282093pls.822.2018.02.21.13.40.40; Wed, 21 Feb 2018 13:40:54 -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=Oq1MZZM6; 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 S1751353AbeBUViu (ORCPT + 99 others); Wed, 21 Feb 2018 16:38:50 -0500 Received: from mail-ot0-f194.google.com ([74.125.82.194]:44354 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbeBUVis (ORCPT ); Wed, 21 Feb 2018 16:38:48 -0500 Received: by mail-ot0-f194.google.com with SMTP id 79so2781318oth.11 for ; Wed, 21 Feb 2018 13:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XWAWTCZCO5DmV/Kc+x9O8BgKmqQiaZh4a8SEFOD/hI4=; b=Oq1MZZM6ldo7p4JKLmIP/1+HRM7wedxlJNEIUrDnJ+ffV09y8M0fSOlhdYGg+V/ln/ Pg3EgMmDl8YUYo+NnuU2kwQUd3VMpOUr87b4EXE+HHSPsOix1MTAQ1omu2H2cqPNMk+2 6I3ixLc79fRt1/GRhjbyA/O+6DYmkIGBb5npg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XWAWTCZCO5DmV/Kc+x9O8BgKmqQiaZh4a8SEFOD/hI4=; b=FxcHgtO+ink3YL7lIrQcRbtSU5yFvtSa3J82jfl48cEktT+Uu3RShiloKRmrfH9Tks kF811IHR7xX/Md5f6lNAa2Zye98xvBAewsf5Yb0s3UX25HMcA+MF+0k2ne5yykdAXskZ C9fnhuKSKhEZWP9lJqlILMyObW4LYDazvhlxS8qojpTzFbpZeo3QMTbIAprRqB8AxByj tjJYoiCGCeMqZois84IHvINQ/h0ijompxD95eK+Dm+ud97Ejzp9reF/pxvW+eRWbi74j J3/dkKuSy3yPlrXvLfIpJv0jWNqS28rqRnnlVTyEc7phZF+hI640RtdA8vpF82htUD8S oCUA== X-Gm-Message-State: APf1xPB4LnAIHEklyLM/LIk57AOLWpGWGmxHSq4CBLWOhaugJP2Ow2Xa ztj664gPd0LZ90CeLfWsctoM9g== X-Received: by 10.157.98.23 with SMTP id g23mr3617768otj.354.1519249127581; Wed, 21 Feb 2018 13:38:47 -0800 (PST) Received: from [192.168.17.115] (CableLink-187-161-113-185.PCs.InterCable.net. [187.161.113.185]) by smtp.gmail.com with ESMTPSA id e2sm14183528oii.46.2018.02.21.13.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 13:38:46 -0800 (PST) Subject: Re: [PATCH] selftests/bpf: tcpbpf_kern: use in6_* macros from glibc To: Anders Roxell , shuah@kernel.org Cc: daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20180221165116.9754-1-anders.roxell@linaro.org> From: =?UTF-8?Q?Daniel_D=c3=adaz?= Message-ID: <02cb5e7d-5119-8501-01b7-9ea0f4b95450@linaro.org> Date: Wed, 21 Feb 2018 15:38:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180221165116.9754-1-anders.roxell@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 10:51 AM, Anders Roxell wrote: > 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 FWIW, this was Tested-by: Daniel Díaz > --- > tools/testing/selftests/bpf/test_tcpbpf_kern.c | 1 - > 1 file changed, 1 deletion(-) > > 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