This OID was added in rS17352 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.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
if_mibdata seems to be not used at all. I can only find the reference in dev/ffec, and even there it is under #ifdef 0.
Might be it should be removed ?
I was thinking about that too as there is no in-tree driver that support that call anyway, but bsnmpd have an option to query it if the driver supports it, so it'd have to be removed too. Anyway, it's probably task for another patch.
If I can remember the theory I had way back when, the purpose of allowing writes to this data was simply to allow a client or administrator to clear the counters. Given the lack of use I think this is a reasonable simplification.
It's rather unfortunate that each driver has implemented these counters as its own device-specific MIB. The purpose for having the generic interface MIB mechanism was for all Ethernet drivers, for example, to export a single standard Ethernet MIB, as defined in the standard, and then SNMP agents (or netstat or other management tools) could implement fully generic code to examine those variables.