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

Submitted by:  Josh <inojosh>
Submitted on:  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>
Project 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>

 

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    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.5