Re: related tables design

"Xuan Pan" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
> On 23/01/2008, Xuan Pan <[email protected]> wrote:
>> > ....run a single "snmpgetnext -r 0 -t 6000 ..." query against this
>> agent,
>> > and single step through the routine until you hit this error.
>> >    What does the structure pointed to by 'pIndex' look like at that
>> point?
>>
>> Well it is a segmentation fault caused by a 'NULL' pIndex pointer (print
>> pIndex returns 0x1). Sadly, it looks wrong.
>
>
> What is the *full* code of:
>    -  the module initialisation routine;
>    -  the getFirst hook routine;
>    -  the getNext hook routine
> ?
>
> Which line of code triggers the segmentation fault?
>
> What is the exact command that you ran to query the agent?

My getNextIpRangeContext function

LPDHCPSETTINGS lpDhcpListEntry =  NULL;
LPCHCPIPRANGE lpDhcpIpRangeEntry = NULL;

lpDhcpIpRangeEntry = (LPDHCPIPRANGE)(*loopContext);
if(!lpDhcpIpRangeEntry)
{
    DEBUGMSGTL((...));
    return NULL;
}
lpDhcpListEntry = lpDhcpIpRangeEntry->parentDhcpNode;
if(!lpDhcpListEntry)
{
     DEBUGMSGTL((....));
     return NULL;
}
if(lpDhcpIpRangeEntry->next)
{
     lpDhcpIpRangeEntry = lpDhcpIpRangeEntry->next;
}
else
{
     lpDhcpListEntry = lpDhcpListEntry->next;
     if(!lpDhcpListEntry)
     {
          return NULL;
     }
     lpDhcpIpRangeEntry = lpDhcpListEntry->lpDhcpIpRangeHead;
}
snmp_set_var_value(pIndex, (u_char *)& lpDhcpEntry->index, sizeof(int));
pIndex = pIndex->next_variable;   //<===At this point===
snmp_set_var_value(pIndex, (u_char *)& lpIpRangeEntry->index, sizeof(int));
...
I just started the agent in gdb debugger and 'next' until the line with
the error and ran 'print pIndex' and I got 0x1

Pan


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.