From patchwork Thu Oct 15 19:27:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David J Wilder X-Patchwork-Id: 54075 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9FJUYRu024237 for ; Thu, 15 Oct 2009 19:30:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935288AbZJOT2D (ORCPT ); Thu, 15 Oct 2009 15:28:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935286AbZJOT2D (ORCPT ); Thu, 15 Oct 2009 15:28:03 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:54072 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935288AbZJOT2B (ORCPT ); Thu, 15 Oct 2009 15:28:01 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e8.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9FFOUPb011592 for ; Thu, 15 Oct 2009 11:24:30 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9FJRPn2249076 for ; Thu, 15 Oct 2009 15:27:25 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9FJROc5017846 for ; Thu, 15 Oct 2009 15:27:24 -0400 Received: from [9.76.198.161] (sig-9-76-198-161.mts.ibm.com [9.76.198.161]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n9FJRMej017729; Thu, 15 Oct 2009 15:27:23 -0400 Subject: Re: [PATCH] link-local address fix for rdma_resolve_addr From: "David J. Wilder" To: Jason Gunthorpe Cc: sean.hefty@intel.com, ewg@lists.openfabrics.org, linux-rdma , pradeep@us.ibm.com, wilder@us.ibm.com In-Reply-To: <20091014174017.GM5191@obsidianresearch.com> References: <1255471781.14513.7.camel@wilder.ibm.com> <20091013231234.GK5191@obsidianresearch.com> <1255537437.14513.28.camel@wilder.ibm.com> <20091014170155.GL5191@obsidianresearch.com> <1255541405.5111.14.camel@wilder.ibm.com> <20091014174017.GM5191@obsidianresearch.com> Date: Thu, 15 Oct 2009 12:27:21 -0700 Message-Id: <1255634841.5111.40.camel@wilder.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-8.el5_2.2) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org --- addr.c.1759 2009-10-13 15:57:48.000000000 -0500 +++ addr.c.ip_local 2009-10-15 14:03:50.000000000 -0500 @@ -390,14 +390,17 @@ static int addr_resolve_local(struct soc case AF_INET6: { struct in6_addr *a; + int found = 0; for_each_netdev(&init_net, dev) if (ipv6_chk_addr(&init_net, &((struct sockaddr_in6 *) dst_in)->sin6_addr, - dev, 1)) + dev, 1)){ + found = 1; break; + } - if (!dev) + if (!found) return -EADDRNOTAVAIL; a = &((struct sockaddr_in6 *) src_in)->sin6_addr; @@ -406,6 +409,8 @@ static int addr_resolve_local(struct soc src_in->sa_family = dst_in->sa_family; ((struct sockaddr_in6 *) src_in)->sin6_addr = ((struct sockaddr_in6 *) dst_in)->sin6_addr; + ((struct sockaddr_in6 *) src_in)->sin6_scope_id = + ((struct sockaddr_in6 *) dst_in)->sin6_scope_id; ret = rdma_copy_addr(addr, dev, dev->dev_addr); } else if (ipv6_addr_loopback(a)) { ret = rdma_translate_ip(dst_in, addr);