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
This commit is contained in:
Pawel Biernacki 2020-06-21 18:40:17 +00:00
parent 7747001b12
commit 9daf71541c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362468

View File

@ -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 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */
}
static SYSCTL_NODE(_net_link_generic, IFMIB_IFDATA, ifdata,
CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_ifdata,
CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ifdata,
"Interface table");