Hello.

The feature remval patches try to replace snmp_increment_statistic and
snmp_increment_statistic_by with empty macros.

This fails as
     1. snmp_increment_statistic_by takes two arguments
     2. Both of them return the resulting value of the statistics
        counter, or 0 on failure. This is actually tested for in various
        places in net-snmp.

The first problem is trivially solvable by means of adding another
argument.

The second problem is harder, the code tries to check if something went
wrong but it is perfectly legal for the counters to reach 0 so checking
for that value is just plain wrong, thus I think a change is needed.

One could make the functions return the next counter value but that
would make it even harder to pretend that the empty macro is equivalent
and it would make it hard to pretend that a constant return value is
correct.

One could make the functions return 1 on success on 0 on failure, but
that is a bigger ABI change.

One could remove the checks for 0 in the netsnmp code base and go on
using the current macros (save for issue #1). This preserves the current
interface but that is arguably less than perfect.

Now I would like some opinions on a reasonable way forward.

/MF


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to