Page MenuHomeFreeBSD

net.link.generic.ifdata.<ifindex>.linkspecific: rework handler
ClosedPublic

Authored by kaktus on Jun 18 2020, 9:23 PM.

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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 ?

This revision is now accepted and ready to land.Jun 20 2020, 7:32 PM

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.

In D25348#559846, @kib wrote:

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 ?

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.