
Henrik,
Aside from the fact, that libSMI should not cause a seg.fault, a SMIv2 MIB module must contain exactly one MODULE-IDENTITY construct. To have two, is not allowed by the SMI and that's probably why nobody has found the bug yet ;-)
Best regards, Frank Fock
Puls, Henrik wrote:
Hello,
i´ve tried to traverse a SMIv2 MIB where one Module Identity is under an other one. See sketch below. I tried to perform a smiGetNextNode on Module Identity 1 to retrieve the Node (Module Identity Node of Module Identity 2 ) but if I do that libsmi produce a segfault because the OID of the Nodeptr is empty. If I do the same on Module Identity 2 I get OBJECT IDENTITY 1 and that's what I want. So my question is whether it is possible or not to traverse the MIB tree through Module Identitys without explicitly loading the next Module Identity because I don't really know if the next node is a ModuleIdentity or a ObjectIdentity. Or is there a other way to do this.
MODULE IDENTITY 1 | --- MODULE IDENTITY 2 | OBJECT IDENTITY 1 . . . OBJECT IDENTITY n
By the way its possible to stop libsmi from segfaulting inside smiGetNextNode if you add || (!nodePtr->oid) inside the part below.
/* did we move outside the common oid prefix of this module? */ for (i = 0; i < modulePtr->prefixNodePtr->oidlen; i++) if ((!nodePtr) || (!nodePtr->oid) || (nodePtr->oid[i] != modulePtr->prefixNodePtr->oid[i])) return NULL;
Regards, Henrik Puls