From patchwork Sat Aug 4 20:41:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 953488 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ZenIV.linux.org.uk Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41jbRg3sp1z9ryt for ; Sun, 5 Aug 2018 06:41:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729478AbeHDWnY (ORCPT ); Sat, 4 Aug 2018 18:43:24 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60778 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727127AbeHDWnY (ORCPT ); Sat, 4 Aug 2018 18:43:24 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fm3Md-0003S4-E4; Sat, 04 Aug 2018 20:41:27 +0000 Date: Sat, 4 Aug 2018 21:41:27 +0100 From: Al Viro To: Boris Pismenny Cc: David Miller , netdev@vger.kernel.org Subject: [PATCH] mellanox: fix the dport endianness in call of __inet6_lookup_established() Message-ID: <20180804204127.GC15082@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org __inet6_lookup_established() expect th->dport passed in host-endian, not net-endian. The reason is microoptimization in __inet6_lookup(), but if you use the lower-level helpers, you have to play by their rules... Signed-off-by: Al Viro diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c index 92d37459850e..be137d4a9169 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_rxtx.c @@ -328,7 +328,7 @@ static int tls_update_resync_sn(struct net_device *netdev, sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo, &ipv6h->saddr, th->source, - &ipv6h->daddr, th->dest, + &ipv6h->daddr, ntohs(th->dest), netdev->ifindex, 0); #endif }