buglwIP - A Lightweight TCP/IP stack - Bugs: bug #55960, SNMP MIB compiler/code generator...

 
 

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

bug #55960: SNMP MIB compiler/code generator does not always parse SIZE for textual conventions

Submitter:  Josh <inojosh>
Submitted:  Tue 19 Mar 2019 11:25:29 PM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  git head

Wed 20 Mar 2019 04:23:29 PM UTC, comment #2: 

Simon,

I've added a minimal MIB to demonstrate the issue in full. It demonstrates the issue with both the size and range.

I actually described it incorrectly in my original post. An OID with:

SYNTAX DisplayString (SIZE (0..64))

Will generate a test, but it uses the SIZE from the original DisplayString definition.

The case where no test is generated is when you have your own custom textual-convention type within your private MIB, and you add a SIZE to that.

A similar issue occurs for custom textual-conventions where the range is used instead of SIZE (for an Integer32 based type).


Josh <inojosh>
Wed 20 Mar 2019 10:42:29 AM UTC, comment #1: 

Could you probably provide a MIB as input with these two examples? That would greatly improve the chance of this getting fixed soon :-)

Simon Goldschmidt <goldsimon>
Group administrator
Tue 19 Mar 2019 11:25:29 PM UTC, original submission:  

When the MIB compiler generates "_scalars_set_test" functions, it doesn't always parse the SIZE for textual conventions.

It does parse the SIZE for a TEXTUAL-CONVENTION that contains SIZE.
It does not parse the SIZE when added onto an existing TEXTUAL-CONVENTION.

Examples:

A working example would be a MIB object with:

SYNTAX DisplayString

Will generate the test:

if (((len >= 0) && (len <= 255)))
{
    err = SNMP_ERR_NOERROR;
}

Which is correct since it parses the SIZE for DisplayString from SNMPv2-TC.

But a MIB object with:

SYNTAX DisplayString (SIZE (0..64))

Will generate NO test, just:

err = SNMP_ERR_NOERROR;

Josh <inojosh>

 

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

Attached Files
file #46593:  TEST-MIB.mib added by inojosh (2KiB - 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 inojosh (Submitted the item)
  •  

    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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-20 inojosh Attached File- Added TEST-MIB.mib, #46593

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code