From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E223FA372A for ; Wed, 16 Oct 2019 11:16:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C26F2067B for ; Wed, 16 Oct 2019 11:16:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390947AbfJPLQu (ORCPT ); Wed, 16 Oct 2019 07:16:50 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:48634 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389063AbfJPLQt (ORCPT ); Wed, 16 Oct 2019 07:16:49 -0400 Received: from [167.98.27.226] (helo=rainbowdash.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iKhIC-0005C7-Va; Wed, 16 Oct 2019 12:16:37 +0100 Received: from ben by rainbowdash.codethink.co.uk with local (Exim 4.92.2) (envelope-from ) id 1iKhIC-0005Eo-Fc; Wed, 16 Oct 2019 12:16:36 +0100 From: "Ben Dooks (Codethink)" To: linux-kernel@lists.codethink.co.uk Cc: "Ben Dooks (Codethink)" , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , "David S. Miller" , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: bpf: type fixes for __be16/__be32 Date: Wed, 16 Oct 2019 12:16:35 +0100 Message-Id: <20191016111635.20089-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org In bpf_skb_load_helper_8_no_cache and bpf_skb_load_helper_16_no_cache they read a u16/u32 where actually these are __be16 and __be32. Fix the following by making the types match: net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:215:32: warning: cast to restricted __be16 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 net/core/filter.c:242:32: warning: cast to restricted __be32 Signed-off-by: Ben Dooks --- Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- net/core/filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index f7338fee41f8..eefb1545b4c6 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -205,7 +205,7 @@ BPF_CALL_2(bpf_skb_load_helper_8_no_cache, const struct sk_buff *, skb, BPF_CALL_4(bpf_skb_load_helper_16, const struct sk_buff *, skb, const void *, data, int, headlen, int, offset) { - u16 tmp, *ptr; + __be16 tmp, *ptr; const int len = sizeof(tmp); if (offset >= 0) { @@ -232,7 +232,7 @@ BPF_CALL_2(bpf_skb_load_helper_16_no_cache, const struct sk_buff *, skb, BPF_CALL_4(bpf_skb_load_helper_32, const struct sk_buff *, skb, const void *, data, int, headlen, int, offset) { - u32 tmp, *ptr; + __be32 tmp, *ptr; const int len = sizeof(tmp); if (likely(offset >= 0)) { -- 2.23.0