From patchwork Tue Oct 13 22:09:40 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: 53559 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 n9DMNmC6024882 for ; Tue, 13 Oct 2009 22:23:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754672AbZJMWKX (ORCPT ); Tue, 13 Oct 2009 18:10:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761464AbZJMWKX (ORCPT ); Tue, 13 Oct 2009 18:10:23 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:56618 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754672AbZJMWKW (ORCPT ); Tue, 13 Oct 2009 18:10:22 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9DM2BBE001965 for ; Tue, 13 Oct 2009 18:02:11 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9DM9k5I258230 for ; Tue, 13 Oct 2009 18:09:46 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9DM6HHs028397 for ; Tue, 13 Oct 2009 18:06:19 -0400 Received: from [9.76.198.161] (sig-9-76-198-161.mts.ibm.com [9.76.198.161]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n9DM6F9I028259; Tue, 13 Oct 2009 18:06:16 -0400 Subject: [PATCH] link-local address fix for rdma_resolve_addr From: "David J. Wilder" To: ewg@lists.openfabrics.org, linux-rdma , pradeep@us.ibm.com, wilder@us.ibm.com Date: Tue, 13 Oct 2009 15:09:40 -0700 Message-Id: <1255471781.14513.7.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 --- drivers/infiniband/core/addr.c.1759 2009-10-13 15:57:48.000000000 -0500 +++ drivers/infiniband/core/addr.c 2009-10-13 16:11:02.000000000 -0500 @@ -278,6 +278,15 @@ static int addr6_resolve_remote(struct s fl.nl_u.ip6_u.daddr = dst_in->sin6_addr; fl.nl_u.ip6_u.saddr = src_in->sin6_addr; + if (ipv6_addr_type(&dst_in->sin6_addr) & IPV6_ADDR_LINKLOCAL){ + if (!dst_in->sin6_scope_id) + return -EINVAL; + if ( src_in->sin6_scope_id && + (src_in->sin6_scope_id != dst_in->sin6_scope_id)) + return -EINVAL; + fl.oif = dst_in->sin6_scope_id; + } + dst = ip6_route_output(&init_net, NULL, &fl); if (!dst) return ret;