buglwIP - A Lightweight TCP/IP stack - Bugs: bug #43790, Sending octet string of Length...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #43790: Sending octet string of Length >255 from SNMP agent

Submitter:  Manoj Kumar <mano49j>
Submitted:  Wed 10 Dec 2014 07:56:43 AM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.4.0

Jump to the original submission

Thu 20 Aug 2015 06:25:15 AM UTC, comment #7: 

Fixed, thanks for the patch.

In snmp_asn1.h/asn1_enc.c, snmp_asn1_enc_oid_cnt() and snmp_asn1_enc_oid() had to be adapted (parameter ident_len is now an u16_t, too). Not all compilers seem to warn about this :-(

Simon Goldschmidt <goldsimon>
Group administrator
Wed 19 Aug 2015 07:07:32 PM UTC, comment #6: 

Converted files #32701 and #32702 into a patch against curret head.

(file #34680)

Simon Goldschmidt <goldsimon>
Group administrator
Mon 22 Dec 2014 10:42:52 AM UTC, comment #5: 

Good, Welcome.
As of now for my application, its working fine.
It will be great if you can share with me the final versions later, after the further modifications required are done.

Manoj Kumar <mano49j>
Mon 22 Dec 2014 10:06:20 AM UTC, comment #4: 

Yes, it's helpful, thanks. However, there are now places where you pass 'value_len' (which is now an u16_t) to a function that takes an u8_t, which can produce faulty behaviour. I'll try to catch these...

Simon Goldschmidt <goldsimon>
Group administrator
Mon 22 Dec 2014 08:16:40 AM UTC, comment #3: 

Hello simon,

Thanks for replying finally.
I am ready to share my changes, so that it might at least saves others time. :)

I made minor changes in two files of LWIP Library.

(1) msg_in.c

This file is present in location src\lwip-1.4.0\src\core\snmp\msg_in.c

(2) snmp_msg.h

This file is present in location src\lwip-1.4.0\src\include\lwip\snmp_msg.h

I attached both the files after modifications.

Please feel free to share with me, whether the above changes were helpful or not.

(file #32701, file #32702)

Manoj Kumar <mano49j>
Mon 22 Dec 2014 07:50:12 AM UTC, comment #2: 

Great to hear you solved it. Could you share your changes with us so that this might possibly be fixed in the lwIP sources for other users, too?

Simon Goldschmidt <goldsimon>
Group administrator
Mon 22 Dec 2014 06:06:14 AM UTC, comment #1: 

I found a solution...!!!

in the file src\lwip-1.4.0\src\core\snmp\msg_in.c , which processes the incoming messages is converting the length of string from u16_t to u8_t. It indicates the range has now deprecated to (0-255). So the problem.

I changed the u8_t's which are restricting me from processing octet string of lenght > 255 to u16_t's.

Now the LWIP Library is able to handle message of length > 255..

Thanks..!!!

Manoj Kumar <mano49j>
Wed 10 Dec 2014 07:56:43 AM UTC, original submission:  


I am using LWIP Libarary that comes with xilinx SDK for implementing a Private MIB SNMP Protocol.

The agent when tries to send an OCTET String of Length > 255, the behavior is suspicious and Message is not being delivered over that particular OID and after agent is unable to respond to any further commands/quiries.


I am wondering is it possible to send an octet string of length >255 , and if possible do i need to make any changes in the library.

Manoj Kumar <mano49j>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #34680:  snmp_longstrings.patch added by goldsimon (5KiB - application/octet-stream)
file #32701:  msg_in.c added by mano49j (42KiB - application/octet-stream)
file #32702:  snmp_msg.h added by mano49j (9KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by mano49j (Submitted the item)
  • -email is unavailable- added by mano49j (my query1)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-20 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
        SummarySending octet string of Length &gt;255 from agent. Sending octet string of Length >255 from SNMP agent
    2015-08-19 goldsimon Attached File- Added snmp_longstrings.patch, #34680
    2015-03-23 goldsimon Planned Release 1.5.0
    2014-12-22 mano49j Attached File- Added msg_in.c, #32701
        Attached File- Added snmp_msg.h, #32702
    2014-12-10 mano49j Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code