Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Oct 2010 22:29:37 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r214043 - projects/ofed/head/sys/ofed/drivers/infiniband/core
Message-ID:  <201010182229.o9IMTbE6088281@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010182229.o9IMTbE6088281>