svn commit: r325600 - stable/11/sys/ofed/include/rdma

Hans Petter Selasky hselasky at FreeBSD.org
Thu Nov 9 17:47:35 UTC 2017


Author: hselasky
Date: Thu Nov  9 17:47:33 2017
New Revision: 325600
URL: https://svnweb.freebsd.org/changeset/base/325600

Log:
  MFC r324492:
  Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a
  valid GID entry based on IPv6 addresses can fail.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/ofed/include/rdma/ib_addr.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/include/rdma/ib_addr.h
==============================================================================
--- stable/11/sys/ofed/include/rdma/ib_addr.h	Thu Nov  9 17:02:20 2017	(r325599)
+++ stable/11/sys/ofed/include/rdma/ib_addr.h	Thu Nov  9 17:47:33 2017	(r325600)
@@ -157,6 +157,12 @@ static inline int rdma_ip2gid(struct sockaddr *addr, u
 	case AF_INET6:
 		memcpy(gid->raw, &((struct sockaddr_in6 *)addr)->sin6_addr,
 				   16);
+		/* make sure scope ID gets zeroed inside GID */
+		if (IN6_IS_SCOPE_LINKLOCAL((struct in6_addr *)gid->raw) ||
+		    IN6_IS_ADDR_MC_INTFACELOCAL((struct in6_addr *)gid->raw)) {
+			gid->raw[2] = 0;
+			gid->raw[3] = 0;
+		}
 		break;
 	default:
 		return -EINVAL;


More information about the svn-src-all mailing list