buglwIP - A Lightweight TCP/IP stack - Bugs: bug #56817, type of pbuf->type_internal too...

 
 

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

bug #56817: type of pbuf->type_internal too short

Submitter:  Klaus Breining <klaus_br>
Submitted:  Tue 27 Aug 2019 03:16:25 PM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  Compiler Warning Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  2.1.1

Wed 28 Aug 2019 06:50:20 AM UTC, comment #3: 

Hello Dirk and Stian Sebastian, lwip itself compiles without warnings. I am using a sample code of Texas Instruments with a port of MatrixSSL, which I currently upgrade to the newest version of that stack. In this code they are using PBUF_RAM to indicate that the payload is in one piece. It seems that in the sample code the warning has been ignored, but it also has no negative impact. As in my modification I need to distinguish between a pbuf coming from the lwip stack or from MatrixSSL, I could also use a "user pbuf" with PBUF_TYPE_ALLOC_SRC_MASK_MIN instead

Klaus Breining <klaus_br>
Wed 28 Aug 2019 06:00:40 AM UTC, comment #2: 

Klaus, can you upload cc.h and lwipopts.h from your project?

Stian Sebastian Skjelstad <mywave>
Wed 28 Aug 2019 05:49:15 AM UTC, comment #1: 

The information in PBUF_ALLOC_FLAG_* is not used anywhere at the moment, so it is not stored on the pbuf.

Where does you compiler complain? There is only one assignment in pbuf_init_alloced_pbuf() - and it has a cast: p->type_internal = (u8_t)type;

Dirk Ziegelmeier <dziegel>
Group administrator
Tue 27 Aug 2019 03:16:25 PM UTC, original submission:  

In file: src/include/lwip/pbuf.h:

struct pbuf->type_internal should contain
PBUF_TYPE_FLAG_* (mask: 0x00f0)
PBUF_TYPE_ALLOC_FLAG_* (mask: 0x0f00)
PBUF_TYPE_ALLOC_SRC_MASK (mask: 0x000f)

but the variable is defined as u8_t. On a TIARM compiler (and I guess also on gcc) this results in a warning

#70-D integer conversion resulted in truncation.

The type should be u16_t instead. Otherwise it cannot be set to "PBUF_RAM" or "PBUF_POOL"

I am using 2.1.2, which cannot be selected in the "lwIP version" field.

Klaus Breining <klaus_br>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mywave (Posted a comment)
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by klaus_br (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.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-08-28 dziegel StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code