Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3826189ybt; Tue, 30 Jun 2020 11:57:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3kizFu45Wx6XAespkYORTdy78+ZZbahPMFcmoKhSlID4BwDTqR+Pllr0UkX4YhMPuq4nv X-Received: by 2002:a17:906:da19:: with SMTP id fi25mr19264873ejb.369.1593543073030; Tue, 30 Jun 2020 11:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593543073; cv=none; d=google.com; s=arc-20160816; b=kpzPEl8oek/PX9ngFT/7OjuR0ePkDxWpczQeeeMcytQmO17lTXhiS0Pcdf1qF4b1MU Vk8B/5ZKcKK2pr82891fKIjB/cdDB059CgHCpsIt9z/ASwR4qeAAiKgPHLVhewH9/Mjp QuqXvuDjktYSoMe5AywtHyEs8MZnFSsF5pm5hso3qm6Q+LcKl+vqUsiz7oWiT3vtkg9L gkd36zTGx8zXJrsH3dgAAwvWj+CmwDBWUyImc/d02gTsPGmsc380A1vaMih5QUrA9gae zgjx7NNMvLs/PJ5pfi8DDwh51vwjIbozJMCoKMC91lFEh8GeuvTH8veVz+dDNDnaUFA8 BdCw== 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:mime-version:user-agent:date:message-id:subject :from:cc:to:dkim-signature; bh=wl8EAQlU5U9NfFNfWCICO6BKBWbdzGclG26DsxfSj2g=; b=hlJHOULydHI/zRyQ1LVDpN8eSeG69xMwTKFkXgjIodgPMcGEtRrcMaZFv48pjfNtGw F/hzdhlFuJDrJ1bZUf1m7o5F2YzZKMgn5cX1rppq4Sn3o/d48SpTOgaJjRmIYYGMpx1c pI0HWPlpnYziIXPw+ETvJJ8Sd0emNxT/L6OFnzJoXDeBnbtb2SXNaQOBXBcZyuTcNuJy EXrWXHvgRv8YIh7o53Z2q46mIZPUIpv4a9LrepQ+orVam7rb0rp5D66GH/fuOhjG2DCg XrgCjYz1d8BrtjxoNuiBz2U0Bntdi+rMlEtE3Ksz5ETe+NYAS1Q16WkrEj5QNfcrOFYy Z3og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=FQHKTBle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si2173106eds.446.2020.06.30.11.50.49; Tue, 30 Jun 2020 11:51:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=FQHKTBle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732714AbgF3R3g (ORCPT + 99 others); Tue, 30 Jun 2020 13:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbgF3R3f (ORCPT ); Tue, 30 Jun 2020 13:29:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A6BBC061755; Tue, 30 Jun 2020 10:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=wl8EAQlU5U9NfFNfWCICO6BKBWbdzGclG26DsxfSj2g=; b=FQHKTBle1w7XJi6kZa+YzV7bRx 2Tr7Hr/5HbN8FfopyB2yWisfPt3LhRHCvEXaGrVDsVnYxilLbz8a3152bIxY3sqIN+lbZyW8pmbII RqZBxiLVWcpKtJVlY4fFzjKMvW41HASMcny9V2DcmC18iafHUzxIB3m0pX11FLL6m07yh7bsCgud9 ICD8LC55/t9PtbIiWqP99ACqBdaHbsIP1Tm3dY9zRcHgFusyR/zxiF27cLAL72uUZY07dNp7ksOMP jYvX10BaKeS+kVfzRaqyBipx0ZOJzHaTzPsbrT+RIpILXcmWbacJOVkRriwvNERFYeIyLKxfvcCwB wHQqQ5EA==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqK4J-0004Iy-EV; Tue, 30 Jun 2020 17:29:15 +0000 To: LKML , "netdev@vger.kernel.org" , bpf Cc: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , David Miller From: Randy Dunlap Subject: [PATCH -next] bpf: fix net/core/filter build errors when INET is not enabled Message-ID: Date: Tue, 30 Jun 2020 10:29:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap Fix build errors when CONFIG_INET is not set/enabled. (.text+0x2b1b): undefined reference to `tcp_prot' (.text+0x2b3b): undefined reference to `tcp_prot' Signed-off-by: Randy Dunlap Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: Andrii Nakryiko Cc: John Fastabend Cc: KP Singh Cc: netdev@vger.kernel.org Cc: bpf@vger.kernel.org --- net/core/filter.c | 4 ++++ 1 file changed, 4 insertions(+) --- linux-next-20200630.orig/net/core/filter.c +++ linux-next-20200630/net/core/filter.c @@ -9328,8 +9328,10 @@ const struct bpf_func_proto bpf_skc_to_t BPF_CALL_1(bpf_skc_to_tcp_timewait_sock, struct sock *, sk) { +#ifdef CONFIG_INET if (sk->sk_prot == &tcp_prot && sk->sk_state == TCP_TIME_WAIT) return (unsigned long)sk; +#endif #if IS_BUILTIN(CONFIG_IPV6) if (sk->sk_prot == &tcpv6_prot && sk->sk_state == TCP_TIME_WAIT) @@ -9350,8 +9352,10 @@ const struct bpf_func_proto bpf_skc_to_t BPF_CALL_1(bpf_skc_to_tcp_request_sock, struct sock *, sk) { +#ifdef CONFIG_INET if (sk->sk_prot == &tcp_prot && sk->sk_state == TCP_NEW_SYN_RECV) return (unsigned long)sk; +#endif #if IS_BUILTIN(CONFIG_IPV6) if (sk->sk_prot == &tcpv6_prot && sk->sk_state == TCP_NEW_SYN_RECV)