Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1546208pxf; Fri, 12 Mar 2021 12:12:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8coGpbwHoI7qzCPIAGptA38kCLa3DI9UkZYh6ewk5IfeenXUuBUNaNUlNtZnUwl70Nin7 X-Received: by 2002:a17:906:1bf2:: with SMTP id t18mr10520003ejg.418.1615579978153; Fri, 12 Mar 2021 12:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615579978; cv=none; d=google.com; s=arc-20160816; b=Y4RykHQsxySldY15+66MZYrHgg+O0c5VucoUCqxiYiZuQVAORL2x0w0TqMyprTI4oT gIovPBEmEL+f/lq0+gAzisdHTlkAMZPhVXT1hRjV0PyZPixQAz6OUD4ozI6d5qGAOB7e Vov3I38Hp1vwUQIbpLUEVyR6+B4QHzChV23bc00TWnClxyCkFSSoiMltWW+Roj8/M9/0 RbNDjpkfGZb19dkHE2XT4YB0NGLUyRYK6U3LBulPHbhS7foybzAtTRcWp8UJfN02/hHb DvreytjtG/Vm7z7/AGNkCYyC/mfvkqLlpgCVT8dhXMHUjyib3vlSZ+2GuyDGiRUVfU2t Vfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=m5YpQ1gg9mlr+QYgTSpX4OBBI/dH4lK1uPJejw2gv10=; b=EPrRktHnRkGCkBqa45yzVltGNLqfoQRXa0FWJzxzO0JEJgHNmrf9l2ohpkNydxvivO 3fn9c3QU/M3RE94Kqhvmul+hMbNkpSx386CkUvHL42lkLTxIRZbNOSv+7eJTJeLnyTx1 8FxAhDDh9P6z48PpvLypP53L7Fa4dWbWRI62WkyoaNzcHYj5ZqX1a2rXr0/WrMWzyeWL bDuSi8KQPzRm57O8u30EOYGZuWKie3qIk5i2BtcSBrI+TNpr7371iHJELz9mbH45FWmV IQoaDRsGvKInajRxH4yHJl8OTsL2uYocxPUa4OZ6ugY+SjGEbVMfPRGG7e2Ra0mk7n5+ xnBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=mo4+o0GY; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si5014292ejj.339.2021.03.12.12.12.35; Fri, 12 Mar 2021 12:12:58 -0800 (PST) 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=pass header.i=@pm.me header.s=protonmail header.b=mo4+o0GY; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234643AbhCLUJf (ORCPT + 99 others); Fri, 12 Mar 2021 15:09:35 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:30578 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234351AbhCLUJK (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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 in= teger 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(-) 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, =09 * avoid confusion with packets without such field =09 */ =09if (icmp_has_id(ih->type)) -=09=09key_icmp->id =3D ih->un.echo.id ? : 1; +=09=09key_icmp->id =3D ih->un.echo.id ? ntohs(ih->un.echo.id) : 1; =09else =09=09key_icmp->id =3D 0; } -- 2.30.2