Date: Thu, 9 Nov 2017 17:47:34 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> 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 Message-ID: <201711091747.vA9HlYki002662@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711091747.vA9HlYki002662>