Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756141AbdDRJzF (ORCPT ); Tue, 18 Apr 2017 05:55:05 -0400 Received: from 1.mo1.mail-out.ovh.net ([178.32.127.22]:45724 "EHLO 1.mo1.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbdDRJzF (ORCPT ); Tue, 18 Apr 2017 05:55:05 -0400 X-Greylist: delayed 10791 seconds by postgrey-1.27 at vger.kernel.org; Tue, 18 Apr 2017 05:55:04 EDT Subject: Re: [PATCH] net/ncsi: fix checksum validation in response packet To: Gavin Shan , David Miller References: <1492160197-13816-1-git-send-email-clg@kaod.org> <20170417.133619.1515025171498720534.davem@davemloft.net> <20170418000600.GA4978@gwshan> Cc: joel@jms.id.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <873115df-2bd0-65f4-22cf-2b92f3142bf2@kaod.org> Date: Tue, 18 Apr 2017 08:16:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170418000600.GA4978@gwshan> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12631471054959971095 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeliedrvdejgdeiiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 855 Lines: 28 On 04/18/2017 02:06 AM, Gavin Shan wrote: > On Mon, Apr 17, 2017 at 01:36:19PM -0400, David Miller wrote: >> From: C?dric Le Goater >> Date: Fri, 14 Apr 2017 10:56:37 +0200 >> >>> htonl was used instead of ntohl. Surely a typo. >>> >>> Signed-off-by: C?dric Le Goater >> >> I don't think so, "checksum" is of type "u32" thus is in host byte >> order. Therefore "htonl()" is correct. >> > > Yeah, "htonl()" is correct here. "*pchecksum" is in big-endian. > I want to know how C?dric thinks it's a problem. I guess he might > encounter the issue on the emulated NCSI channel by QEMU. yes exactly. my bad. After a second look this is correct. Sorry for the noise. > On BCM5718 or BCM5719, the checksum in AEN and response packet > are zero'd, meaning the software shouldn't validate it at all. Interesting. Thanks, C.