On 19/09/06, Dave Shield <[EMAIL PROTECTED]> wrote:
> I don't think it's the HAL code - it appears to be a deficiency in the
> scalar_group helper (or possibly the higher-level MIB registry
> handling).

Confirmed.
The "find_prefix" routine (in snmplib/snmp_api.c) wasn't handling the
case where one OID was a strict prefix of the other.  It returned 0,
rather than the length of the common prefix.   Fixing this allowed the
original memory code to work correctly.

I'm also not convinced that the value returned by this routine is correct.
It seems to report the (1-based) index of the first *mis-match* in the OIDs,
rather than the length of the common prefix (as documented).
   AFAICT, the return value is never actually used as such - just
compared to see whether there was a match.  So it ought to be safe to
correct this.
But I haven't checked the code carefully, so this may be wrong.

Comments?

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to