From patchwork Fri Mar 12 20:08:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12135931 X-Patchwork-Delegate: kuba@kernel.org 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 948FEC433E0 for ; Fri, 12 Mar 2021 20:10:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6484764F88 for ; Fri, 12 Mar 2021 20:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234637AbhCLUJe (ORCPT ); Fri, 12 Mar 2021 15:09:34 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:49467 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234587AbhCLUJK (ORCPT ); Fri, 12 Mar 2021 15:09:10 -0500 Date: Fri, 12 Mar 2021 20:08:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615579744; bh=m5YpQ1gg9mlr+QYgTSpX4OBBI/dH4lK1uPJejw2gv10=; h=Date:To:From:Cc:Reply-To:Subject:From; b=mo4+o0GYaZzYe+GqN6g44ZacwsLT5284lKxGvSuEN6lodY6NVTIqGoRuFKSAfnME0 4x7PRjPeQbf6sUjFTva8tbaj4UyrcKm6cQHN2sFbkco5E3wGbAXJnvoMRu9V6uOJqr bag0QsJXARFBa2TIJu0FKSQuurrjl1SHk09t0D63aDc038iwOaqh1FII2ZI72O1xr6 vaZlSMs7mMMh4j4IQ+fy+dF/NEEEmKnYZCeki1br+3uWeTL8OpSUdK6yixQSSlEv2f HfpbXl7uf7id6OQG5Bl5ME620j17JRLc8qP0toPmMNY6lh9h1xoaEUxrjwSx9ZOYeb T0m1Y81D/akhQ== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Jakub Sitnicki , Alexei Starovoitov , Andrii Nakryiko , Vladimir Oltean , Davide Caratti , Guillaume Nault , wenxu , Eran Ben Elisha , Matteo Croce , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Lobakin Reply-To: Alexander Lobakin Subject: [PATCH net] flow_dissector: fix byteorder of dissected ICMP ID Message-ID: <20210312200834.370667-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org flow_dissector_key_icmp::id is of type u16 (CPU byteorder), ICMP header has its ID field in network byteorder obviously. Sparse says: net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to integer Convert ID value to CPU byteorder when storing it into flow_dissector_key_icmp. Fixes: 5dec597e5cd0 ("flow_dissector: extract more ICMP information") Signed-off-by: Alexander Lobakin --- net/core/flow_dissector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 2ef2224b3bff..a96a4f5de0ce 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -176,7 +176,7 @@ void skb_flow_get_icmp_tci(const struct sk_buff *skb, * avoid confusion with packets without such field */ if (icmp_has_id(ih->type)) - key_icmp->id = ih->un.echo.id ? : 1; + key_icmp->id = ih->un.echo.id ? ntohs(ih->un.echo.id) : 1; else key_icmp->id = 0; }