From owner-svn-src-stable@freebsd.org Thu Nov 9 17:47:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59B0FE56FE4; Thu, 9 Nov 2017 17:47:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FFF670B23; Thu, 9 Nov 2017 17:47:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9HlY6l002663; Thu, 9 Nov 2017 17:47:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9HlYki002662; Thu, 9 Nov 2017 17:47:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091747.vA9HlYki002662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325600 - stable/11/sys/ofed/include/rdma X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/include/rdma X-SVN-Commit-Revision: 325600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:47:35 -0000 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;