Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752795AbdDNNnn (ORCPT ); Fri, 14 Apr 2017 09:43:43 -0400 Received: from 4.mo178.mail-out.ovh.net ([46.105.49.171]:34957 "EHLO 4.mo178.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbdDNNnl (ORCPT ); Fri, 14 Apr 2017 09:43:41 -0400 X-Greylist: delayed 17203 seconds by postgrey-1.27 at vger.kernel.org; Fri, 14 Apr 2017 09:43:40 EDT From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: "David S. Miller" Cc: Gavin Shan , Joel Stanley , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH] net/ncsi: fix checksum validation in response packet Date: Fri, 14 Apr 2017 10:56:37 +0200 Message-Id: <1492160197-13816-1-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10292695474233445156 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeliedrvddtgddtlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 612 Lines: 22 htonl was used instead of ntohl. Surely a typo. Signed-off-by: Cédric Le Goater --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 087db775b3dc..d375286b79f2 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -52,7 +52,7 @@ static int ncsi_validate_rsp_pkt(struct ncsi_request *nr, checksum = ncsi_calculate_checksum((unsigned char *)h, sizeof(*h) + payload - 4); - if (*pchecksum != htonl(checksum)) + if (*pchecksum != ntohl(checksum)) return -EINVAL; return 0; -- 2.7.4