svn commit: r329307 - stable/11/sys/ofed/drivers/infiniband/core
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Feb 15 09:05:30 UTC 2018
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);
More information about the svn-src-stable-11
mailing list