Date: Thu, 15 Feb 2018 09:05:29 +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: r329307 - stable/11/sys/ofed/drivers/infiniband/core Message-ID: <201802150905.w1F95TQa088862@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Feb 15 09:05:29 2018 New Revision: 329307 URL: https://svnweb.freebsd.org/changeset/base/329307 Log: MFC r325806: Make sure a valid VNET is set before trying to access the V_ip6_v6only variable. Access the variable directly instead of going through the sysctl() interface in the kernel. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/cma.c Thu Feb 15 09:04:06 2018 (r329306) +++ stable/11/sys/ofed/drivers/infiniband/core/cma.c Thu Feb 15 09:05:29 2018 (r329307) @@ -2734,10 +2734,6 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct socka { struct rdma_id_private *id_priv; int ret; -#if defined(INET6) - int ipv6only; - size_t var_size = sizeof(int); -#endif if (addr->sa_family != AF_INET && addr->sa_family != AF_INET6) return -EAFNOSUPPORT; @@ -2765,9 +2761,11 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct socka if (addr->sa_family == AF_INET) id_priv->afonly = 1; #if defined(INET6) - else if (addr->sa_family == AF_INET6) - id_priv->afonly = kernel_sysctlbyname(&thread0, "net.inet6.ip6.v6only", - &ipv6only, &var_size, NULL, 0, NULL, 0); + else if (addr->sa_family == AF_INET6) { + CURVNET_SET_QUIET(&init_net); + id_priv->afonly = V_ip6_v6only; + CURVNET_RESTORE(); + } #endif } ret = cma_get_port(id_priv);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802150905.w1F95TQa088862>