Date: Fri, 30 Mar 2018 18:42:44 +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: r331789 - stable/11/sys/ofed/drivers/infiniband/core Message-ID: <201803301842.w2UIgiwG082964@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Mar 30 18:42:44 2018 New Revision: 331789 URL: https://svnweb.freebsd.org/changeset/base/331789 Log: MFC r330584: Recover IPv6 scope ID for multicast link-local addresses as well as unicast link-local addresses. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Mar 30 18:41:27 2018 (r331788) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Mar 30 18:42:44 2018 (r331789) @@ -2785,7 +2785,8 @@ static int cma_bind_addr(struct rdma_cm_id *id, struct struct sockaddr_in6 *src_addr6 = (struct sockaddr_in6 *) src_addr; struct sockaddr_in6 *dst_addr6 = (struct sockaddr_in6 *) dst_addr; src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id; - if (IN6_IS_SCOPE_LINKLOCAL(&dst_addr6->sin6_addr)) + if (IN6_IS_SCOPE_LINKLOCAL(&dst_addr6->sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&dst_addr6->sin6_addr)) id->route.addr.dev_addr.bound_dev_if = dst_addr6->sin6_scope_id; } else if (dst_addr->sa_family == AF_IB) { ((struct sockaddr_ib *) src_addr)->sib_pkey = @@ -3119,13 +3120,13 @@ static int cma_check_linklocal(struct rdma_dev_addr *d sin6 = *(struct sockaddr_in6 *)addr; - if (!(IN6_IS_SCOPE_LINKLOCAL(&sin6.sin6_addr))) - return 0; - - if (sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0) - return -EINVAL; - - dev_addr->bound_dev_if = sin6.sin6_scope_id; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&sin6.sin6_addr)) { + /* check if IPv6 scope ID is set */ + if (sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0) + return -EINVAL; + dev_addr->bound_dev_if = sin6.sin6_scope_id; + } #endif return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803301842.w2UIgiwG082964>