View Single Post

  #2 (permalink)  
Old 06-20-2008
Rucha
 
Posts: n/a
Default RE: Getting Too Long Error

Hi Dave,

Here is the dump of pdu.

(gdb) p pdu
$1 = (netsnmp_pdu *) 0x951b398
(gdb) p *$1
$2 = {version = -1, command = 160, reqid = 713309340, msgid = 1415423209,
transid = 0, sessid = 0, errstat = -1,
errindex = -1, time = 0, flags = 0, securityModel = -1, securityLevel = 0,
msgParseModel = 0, transport_data = 0x0,
transport_data_length = 0, tDomain = 0x0, tDomainLen = 0, variables = 0x0,
community = 0x0, community_len = 0,
enterprise = 0x0, enterprise_length = 0, trap_type = 0, specific_type = 0,
agent_addr = "\000\000\000",
contextEngineID = 0x0, contextEngineIDLen = 0, contextName = 0x0,
contextNameLen = 0, securityEngineID = 0x0,
securityEngineIDLen = 0, securityName = 0x0, securityNameLen = 0, priority
= 0, range_subid = 0, securityStateRef = 0x0}

135 int length = sizeof(pdu);
(gdb) n
137 printf("PDU Length = %d\n", length);
(gdb) n
PDU Length = 4
139 status = snmp_synch_response(ss, pdu, &response);
(gdb) p length
$4 = 4

Regards,
Rucha

-----Original Message-----
From: dave.shield@googlemail.com [mailto:dave.shield@googlemail.com] On
Behalf Of Dave Shield
Sent: Thursday, June 19, 2008 8:18 PM
To: Rucha
Cc: Pranesh Kulkarni; Net-snmp-users@lists.sourceforge.net
Subject: Re: Getting Too Long Error

2008/6/19 Rucha <rucha_mahajan@persistent.co.in>:
> I checked the size of pdu which I am sending, its size of just 4bytes.


An SNMP PDU of just 4 bytes!!?
Can you please post a packet dump of this request.


> Any other reason for getting this error ?


Given that a GET PDU will typically be at *least* 30 bytes in size,
and the absolute minimum size of a completely empty GET
request is (I think) 18 bytes - if your GET request is just 4 bytes,
then it's almost certainly invalid.
If it's malformed, then the parsing code might well be reading
the length as over-size, and returning a tooLong error.


Dave


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

Reply With Quote