From patchwork Fri Jun 9 10:49:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 9778023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B571560393 for ; Fri, 9 Jun 2017 10:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4C7F26E4D for ; Fri, 9 Jun 2017 10:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9752C28429; Fri, 9 Jun 2017 10:49:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CED1626E4D for ; Fri, 9 Jun 2017 10:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751667AbdFIKtr (ORCPT ); Fri, 9 Jun 2017 06:49:47 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:12882 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbdFIKtp (ORCPT ); Fri, 9 Jun 2017 06:49:45 -0400 Received: from localhost (fastrack.blr.asicdesigners.com [10.193.185.157]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id v59AnTho004441; Fri, 9 Jun 2017 03:49:34 -0700 From: Raju Rangoju To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: swise@opengridcomputing.com, rajur@chelsio.com Subject: [PATCH 1/1] rdma: copy the saddr if it is already resolved Date: Fri, 9 Jun 2017 16:19:25 +0530 Message-Id: <20170609104925.28927-1-rajur@chelsio.com> X-Mailer: git-send-email 2.13.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The recent changes to addr6_resolve() to call ipv6 route lookup via the stub interface broke cxgb4/ipv6. If the source address is already resolved by ipv6_dst_lookup() then the check ipv6_addr_any(&fl6.saddr) would fail; consequently, copying saddr to the src_in buffer is omitted. This commit addresses the above issue by moving the copy code out of the ipv6_addr_any() block in addr6_resolve(). Signed-off-by: Raju Rangoju Tested-by: Robert LeBlanc --- drivers/infiniband/core/addr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 02971e239a18..c32477907765 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -454,11 +454,11 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, &fl6.daddr, 0, &fl6.saddr); if (ret) goto put; - - src_in->sin6_family = AF_INET6; - src_in->sin6_addr = fl6.saddr; } + src_in->sin6_family = AF_INET6; + src_in->sin6_addr = fl6.saddr; + /* If there's a gateway and type of device not ARPHRD_INFINIBAND, we're * definitely in RoCE v2 (as RoCE v1 isn't routable) set the network * type accordingly.