Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1721124ybg; Sat, 19 Oct 2019 01:04:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHH/2ab0Ty40nya8ixmQ+lhErPF6oyxs3uZHnppwP91ratEx0W/pZgsjF0jgnyOhigOxuW X-Received: by 2002:aa7:d389:: with SMTP id x9mr14090174edq.33.1571472262711; Sat, 19 Oct 2019 01:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571472262; cv=none; d=google.com; s=arc-20160816; b=V1VRjii1X7zedymSb7lz5DCJWk6DFz0jeiQMUoiKTpMomLyM5WMJPy1rS/NBYSdZw7 XOVQivAfD/9XNgQB24VU2OqDt1ulxIGv6cgtikFxNYAYEiW5htOoa6DTncaofcXwLuOD Xfvh5oNnlWmfY1Exv3FIMWLCbB3k7W+bch1hgtD52GG/NVrrTJDThj8YhAECpvXc8k8e PoXlLqOX5LPdG9ThrlCUIJbpvNnVYR4c0M3tZv2WCZPY1HgAcUnMRsv9bHCWqQ7FI1aF 9YD8/dW4HneI2KRaAIjGzntdLD196JjPL0LOlBrmXVhlRwDBXFIJkQMbUwQTF7bwsMkz 5GpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=SWR4iYF2xZyuFvl/3PImKLRJR/Ag8CtElMFwpTWQk6Y=; b=TMQjF+CtoLI8I4SV5fCKPxKR2mieFsR+1RjiK90Eowr5XM5je1eH6vdXdK0norDWWv tuXTr2uFaKTXNa87Ay+ybMZl6Rbltka0bbehroekMjQsMgBfe1eISfjMiM9LgcqCooep zszMm7rWeE25br/2oVdrrboji16oxMGu/qp+IpHLb5HRQ7ZiLvdrQRGdkzxQFVFuAZaO 0dUjbkkiJOUuSHEZoN3KMxn9HP1PpRF7kwqeYfmyzr7xVDT5G/Ybbyuydsfu0v5SwPQ9 A5KKjuK4/VSKsyd06A58ESbCZDTD4ucW/jq8CPXDGMcQfcweJd87wDY+Al9OfrYCaTU9 2t0A== 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 gf2si469742ejb.393.2019.10.19.01.03.59; Sat, 19 Oct 2019 01:04:22 -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; 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 S2632960AbfJRJGH (ORCPT + 99 others); Fri, 18 Oct 2019 05:06:07 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:53488 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727741AbfJRJGH (ORCPT ); Fri, 18 Oct 2019 05:06:07 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7138B24653149FBE9F7C; Fri, 18 Oct 2019 17:06:04 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 18 Oct 2019 17:05:54 +0800 From: YueHaibing To: , , , , , , , CC: , , , YueHaibing Subject: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET Date: Fri, 18 Oct 2019 17:03:44 +0800 Message-ID: <20191018090344.26936-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_NET is n, building fails: kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto': bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto' Wrap it into a #ifdef to fix this. Reported-by: Hulk Robot Fixes: a7658e1a4164 ("bpf: Check types of arguments passed into helpers") Signed-off-by: YueHaibing --- kernel/trace/bpf_trace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 52f7e9d..c324089 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -1055,8 +1055,10 @@ raw_tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) switch (func_id) { case BPF_FUNC_perf_event_output: return &bpf_perf_event_output_proto_raw_tp; +#ifdef CONFIG_NET case BPF_FUNC_skb_output: return &bpf_skb_output_proto; +#endif case BPF_FUNC_get_stackid: return &bpf_get_stackid_proto_raw_tp; case BPF_FUNC_get_stack: -- 2.7.4