Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2018 18:44:51 +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: r331791 - stable/11/sys/ofed/drivers/infiniband/core
Message-ID:  <201803301844.w2UIipjG083190@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Mar 30 18:44:51 2018
New Revision: 331791
URL: https://svnweb.freebsd.org/changeset/base/331791

Log:
  MFC r330586:
  Make sure VNET is set when calling sa6_recoverscope() in ibcore.
  
  Else panic will occur when VIMAGE is enabled.
  
  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:43:38 2018	(r331790)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c	Fri Mar 30 18:44:51 2018	(r331791)
@@ -3122,8 +3122,14 @@ static int cma_check_linklocal(struct rdma_dev_addr *d
 
 	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)
+		bool failure;
+
+		CURVNET_SET_QUIET(dev_addr->net);
+		failure = sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0;
+		CURVNET_RESTORE();
+
+		/* check if IPv6 scope ID is not set */
+		if (failure)
 			return -EINVAL;
 		dev_addr->bound_dev_if = sin6.sin6_scope_id;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803301844.w2UIipjG083190>