Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2830495pxf; Sun, 14 Mar 2021 13:42:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ5p/k24ju8xW0E14nKKslLftHAfCo/G4wX5aJROZ+FSJOZXbPVwXyuOQzwvFqqRSv4AAj X-Received: by 2002:a17:906:bcfc:: with SMTP id op28mr19832344ejb.238.1615754534347; Sun, 14 Mar 2021 13:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615754534; cv=none; d=google.com; s=arc-20160816; b=ztxdy7QA1zF5BSyDKH7w1dfa+vmNYbCF0EFczKJdcVTx8+mb9uht1GWpwoJLQ9PMI8 vuxmkV4ciL0xrCS3Mw292GrT8vQM5CtaNBjvWPMppILXWKavWBR8B5FR6EnN4YfV3Crk rbOJPSJzxVsFwfdFmDjorzT+dBXdNZEOHkN2V3Ff8RDsaUtwdecZDWnUkeKYeOfI1G6p out8aGhEBu3nkvv2jA66WETcZh3XwxeNpAov222vH3iOQxnp6zsZ7s9UZ18amBq7Cdjj mh0gcfu4uRQCVXo5UlI0onzXk9i9cMc5OUFbXI2UkOp7YG5HQve1ByLriKDCTIv6G3lz enzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references:dkim-signature; bh=KhQ8GQxemSKjASj94bgK9DXuv0kgFGsdClfGRmeqb+w=; b=d/y4rakLahkadqZachLLprOPMvXu/esrvgY9Jqd7FkOPXykahUC9fwUdDBhBaAYrM0 HTCI7nB8YRf3i6yuCiSbGzZWlcxH5kQseM+GO4KO5XjedKx2qfiMQSP044y+Yfseicwb y0IfpH7Lf6cp+PtsLD7G+i7MntJJ7/N1S04dJLlQubN27E+HIF07/EkmD8LiQNW21J3K kAHT4PEE3nX3bruP3yYJYmM1IXx9dnCVTRN0GewomNFO7LJ6hikpfrboTJqzOCQ48v4r 6xUHT7cbE+dAJuAK8H2T547KfoMv8LL+UgJ+5YZ6qluU5DEimglkjkNXA3jTjUyR3rb5 y8Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=dMXp6S+x; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si9301803edv.223.2021.03.14.13.41.51; Sun, 14 Mar 2021 13:42:14 -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=pass header.i=@cloudflare.com header.s=google header.b=dMXp6S+x; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234540AbhCNUWK (ORCPT + 99 others); Sun, 14 Mar 2021 16:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234481AbhCNUVo (ORCPT ); Sun, 14 Mar 2021 16:21:44 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB90C061574 for ; Sun, 14 Mar 2021 13:21:44 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id s17so13799581ljc.5 for ; Sun, 14 Mar 2021 13:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=KhQ8GQxemSKjASj94bgK9DXuv0kgFGsdClfGRmeqb+w=; b=dMXp6S+xwIo7qP43hDz1KOxUK23QlXQC8lOseG8YAKVLaZg2QtX2z3Aq+wqZwyh021 WHFMGrVl8mVdp8TTB97gVZ0ORswGNaiiSaJfjaZfvq/CDBdqfS3t4YK6pkr8klGfD4Ol nDbvnzmqQad3kg7iIox5KpBbRdOxU/IQi848E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=KhQ8GQxemSKjASj94bgK9DXuv0kgFGsdClfGRmeqb+w=; b=AGUXWHHl0mJ55H9RotgmCSEJsr56d7mg4CRuOW53d3Ejkerzd3lhE+m2ZppAFsIRah siekMsPGCtKgbMQ5wyxlKmM8udBvwzHxni5vxPmWG2lxHdwqI66fK3zwEufVwLfiZs1y 5+t9qk0rCfIhoXQqoTGTl6P9sHqHSDnwJ3jRhOfZRaYZHwGuVTIF3TrLp4kELXz9OflA roQFzhpia6JVS5PKOmQnWjKMgG9FmnEUJ2/xDB6ObuTpbyTNGc6FOpK1u+zDnHa9CWiu HYUvEL2btyNR/aSPXYxK1+34nAFfIq5bEi0BJ5V11E6B9bCq9k6Vd8rqyOrGCoqN9Bm0 oTfw== X-Gm-Message-State: AOAM533K2QyEpkKnLOMN+qU13Ko30gIc0iMGGM5genj20rJSnslcNfTx ja3OmH9GIKGgHoUaobdJip3Bjg== X-Received: by 2002:a2e:85d9:: with SMTP id h25mr2316715ljj.81.1615753302434; Sun, 14 Mar 2021 13:21:42 -0700 (PDT) Received: from cloudflare.com (83.31.58.229.ipv4.supernova.orange.pl. [83.31.58.229]) by smtp.gmail.com with ESMTPSA id h23sm2439198lfm.299.2021.03.14.13.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 13:21:41 -0700 (PDT) References: <20210312200834.370667-1-alobakin@pm.me> User-agent: mu4e 1.1.0; emacs 27.1 From: Jakub Sitnicki To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , 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 Subject: Re: [PATCH net] flow_dissector: fix byteorder of dissected ICMP ID In-reply-to: <20210312200834.370667-1-alobakin@pm.me> Date: Sun, 14 Mar 2021 21:21:40 +0100 Message-ID: <87wnu932qz.fsf@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 12, 2021 at 09:08 PM CET, Alexander Lobakin wrote: > 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(-) > > 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; > } Smells like a breaking change for existing consumers of this value. How about we change the type of flow_dissector_key_icmp{}.id to __be16 instead to make sparse happy?