From owner-svn-src-projects@FreeBSD.ORG Mon Oct 18 22:29:37 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E16CA106564A; Mon, 18 Oct 2010 22:29:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53D88FC0C; Mon, 18 Oct 2010 22:29:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9IMTbfM088283; Mon, 18 Oct 2010 22:29:37 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9IMTbE6088281; Mon, 18 Oct 2010 22:29:37 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201010182229.o9IMTbE6088281@svn.freebsd.org> From: Jeff Roberson Date: Mon, 18 Oct 2010 22:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214043 - projects/ofed/head/sys/ofed/drivers/infiniband/core X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2010 22:29:38 -0000 Author: jeff Date: Mon Oct 18 22:29:37 2010 New Revision: 214043 URL: http://svn.freebsd.org/changeset/base/214043 Log: - Improve IPV6 support in cma by using the correct defines and BSD comparison functions. This may be a candidate for revision later with a thunking layer. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/drivers/infiniband/core/cma.c Modified: projects/ofed/head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/core/cma.c Mon Oct 18 22:28:30 2010 (r214042) +++ projects/ofed/head/sys/ofed/drivers/infiniband/core/cma.c Mon Oct 18 22:29:37 2010 (r214043) @@ -1265,6 +1265,7 @@ static void cma_set_compare_data(enum rd cma_mask->dst_addr.ip4.addr = htonl(~0); } break; +#ifdef INET6 case AF_INET6: ip6_addr = ((struct sockaddr_in6 *) addr)->sin6_addr; if (ps == RDMA_PS_SDP) { @@ -1281,6 +1282,7 @@ static void cma_set_compare_data(enum rd sizeof cma_mask->dst_addr.ip6); } break; +#endif default: break; } @@ -1373,7 +1375,7 @@ static int iw_conn_req_handler(struct iw mutex_lock_nested(&conn_id->handler_mutex, SINGLE_DEPTH_NESTING); conn_id->state = CMA_CONNECT; - dev = ip_dev_find(&init_net, iw_event->local_addr.sin_addr.s_addr); + dev = ip_dev_find(NULL, iw_event->local_addr.sin_addr.s_addr); if (!dev) { ret = -EADDRNOTAVAIL; mutex_unlock(&conn_id->handler_mutex); @@ -2293,14 +2295,18 @@ out: static int cma_check_linklocal(struct rdma_dev_addr *dev_addr, struct sockaddr *addr) { -#if defined(CONFIG_IPv6) || defined(CONFIG_IPV6_MODULE) +#if defined(INET6) struct sockaddr_in6 *sin6; if (addr->sa_family != AF_INET6) return 0; sin6 = (struct sockaddr_in6 *) addr; +#ifdef __linux__ if ((ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) && +#else + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) && +#endif !sin6->sin6_scope_id) return -EINVAL;