Received: by 10.223.185.116 with SMTP id b49csp1310183wrg; Wed, 21 Feb 2018 16:24:43 -0800 (PST) X-Google-Smtp-Source: AH8x225bQai+IGqH/ZxV5gwhNmpufeQr23nosGEOOfobaBsqQpLr0Gg+wc5CfPZD37sQJoO2p8sB X-Received: by 10.101.80.193 with SMTP id s1mr4097903pgp.254.1519259083175; Wed, 21 Feb 2018 16:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519259083; cv=none; d=google.com; s=arc-20160816; b=DLGNBbEXLC4/JHKflgevoNeHRHd0ewO2cDpvX99f7K8bGzIKAU6j5Uh7DZ8OJazasC KEQu8vD66pWmE4Vtc3E8Ge0tXcozEKz0MH0z7mHWmorzuaf8XOWP/oBBa9C/CINFNFJ1 VI+PZ33dIUa4+cOXKQa9LetEwfddTRvd/dI0hPN5RcQCtDJAvDEna7qOQCHSvx/36P+V ZFQZraxwC1kt77J6b0hvrEKnFVv1hsC/td6Scz8+htQvKML6oOH0QNX9HSsMzhtYQX+u A5uxR/MAabitgIl5NDDzQJ2Xteb2MmTiTNRrJY+hQMgJqELrF+0e6Jtn0Y2qhC/sj+gi 9K1w== 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:arc-authentication-results; bh=rsWWflXYoDqE6XdOsHTatdEuXVR0UGerqy3OcvE9+OI=; b=FG8bIpozyqkpj1OMGPtVMP0WOzuJHIr9MHDdxoyBjJM0rzPhe5EWpWjVOLewUDwCjm OUipdV1wdktn8e8UOIL5LvFCSCSZa+C5QbezH/3uomUDsMtZ7j8iX95W17yt057pa3s2 ZrbpoNlQcFlFSYBnBwgMCdH6BFKrX3g/508EuF8/OcfZXHJeToHL9OmDDynixLMrIosr gzjFUnAtbouWxiqlkwQQomk1y4AVkpojrUU0BhQeCvrBGCzgpaYT90N+/oSkdbK4m5wp cxNY8AT9OJaI8lBVgazCzk4/wxM1mpNT+ZWVtO7WAcue7VKzKEyt1ySC11vEb/t2HTrT EunQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si8617347pgr.447.2018.02.21.16.24.28; Wed, 21 Feb 2018 16:24:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbeBVAXj (ORCPT + 99 others); Wed, 21 Feb 2018 19:23:39 -0500 Received: from www62.your-server.de ([213.133.104.62]:53306 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbeBVAXh (ORCPT ); Wed, 21 Feb 2018 19:23:37 -0500 Received: from [62.202.221.135] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1eoefc-0005Bu-Cj; Thu, 22 Feb 2018 01:23:32 +0100 Subject: Re: [PATCH] selftests/bpf: tcpbpf_kern: use in6_* macros from glibc To: Anders Roxell , shuah@kernel.org Cc: 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: Daniel Borkmann Message-ID: <1e230f62-7ee7-93b5-354d-cb2b708d6034@iogearbox.net> Date: Thu, 22 Feb 2018 01:23:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.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 X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24336/Wed Feb 21 18:21:56 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 05:51 PM, 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 Applied to bpf tree, thanks Anders!