Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jun 2020 18:40:17 +0000 (UTC)
From:      Pawel Biernacki <kaktus@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r362468 - head/sys/net
Message-ID:  <202006211840.05LIeHX5043863@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kaktus
Date: Sun Jun 21 18:40:17 2020
New Revision: 362468
URL: https://svnweb.freebsd.org/changeset/base/362468

Log:
  net.link.generic.ifdata.<ifindex>.linkspecific: rework handler
  
  This OID was added in r17352 but the write path of IFDATA_LINKSPECIFIC
  seems unused as there are no in-base writers, and as far as I can tell
  we had issues with this code before, see PR 219472.  Drop the write path
  to make the handler read-only as described in comments and man-pages.
  It can be marked as MPSAFE now.
  
  Reviewed by:	bdragon, kib, melifaro, wollman
  Approved by:	kib (mentor)
  Sponsored by:	Mysterious Code Ltd.
  Differential Revision:	https://reviews.freebsd.org/D25348

Modified:
  head/sys/net/if_mib.c

Modified: head/sys/net/if_mib.c
==============================================================================
--- head/sys/net/if_mib.c	Sun Jun 21 16:06:01 2020	(r362467)
+++ head/sys/net/if_mib.c	Sun Jun 21 18:40:17 2020	(r362468)
@@ -122,10 +122,6 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! 
 		error = SYSCTL_OUT(req, ifp->if_linkmib, ifp->if_linkmiblen);
 		if (error || !req->newptr)
 			goto out;
-
-		error = SYSCTL_IN(req, ifp->if_linkmib, ifp->if_linkmiblen);
-		if (error)
-			goto out;
 		break;
 
 	case IFDATA_DRIVERNAME:
@@ -152,6 +148,6 @@ out:
 }
 
 static SYSCTL_NODE(_net_link_generic, IFMIB_IFDATA, ifdata,
-    CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_ifdata,
+    CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ifdata,
     "Interface table");
 



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