buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51525, MQTT_OUTPUT_RINGBUF_SIZE validation

 
 

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

bug #51525: MQTT_OUTPUT_RINGBUF_SIZE validation

Submitted by:  Vua Hoa <vuahoa07>
Submitted on:  Fri 21 Jul 2017 10:17:26 AM UTC  
 
Category: ContribSeverity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Dirk Ziegelmeier <dziegel>
Open/Closed: ClosedPlanned Release: None
lwIP version: 2.0.2

Thu 27 Jul 2017 03:38:39 AM UTC, comment #3:

I've tested your changes. It works well. Thanks.

Vua Hoa <vuahoa07>
Wed 26 Jul 2017 04:54:16 PM UTC, comment #2:

Tried to fix all problem - Vua, can you test my changes?

Dirk Ziegelmeier <dziegel>
Project MemberIn charge of this item.
Mon 24 Jul 2017 07:50:47 PM UTC, comment #1:

Reading the code, the 'mqtt_ringbuf_len()' does not seem to work for wraparounds, too.

In that case, we might want to refactor the ring buffer instead of just making it check for config==power-of-two...

Simon Goldschmidt <goldsimon>
Project Administrator
Fri 21 Jul 2017 10:17:26 AM UTC, original submission:

In my settings, MQTT_OUTPUT_RINGBUF_SIZE must be 2^n (e.g 256, 1024, 2048...) or the TCP output packet will be un-determined!

Cause:

#define MQTT_RINGBUF_IDX_MASK ((MQTT_OUTPUT_RINGBUF_SIZE) - 1)

/** Add single item to ring buffer */
#define mqtt_ringbuf_put(rb, item) ((rb)->buf)[(rb)->put++ & MQTT_RINGBUF_IDX_MASK] = (item)

Solution: must carefully check MQTT_OUTPUT_RINGBUF_SIZE value, or implement a new way of putting RING buffer.

Vua Hoa <vuahoa07>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dziegel (Posted a comment)
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by vuahoa07 (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 27 Jul 2017 06:10:01 AM UTCdziegelStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 26 Jul 2017 04:54:28 PM UTCdziegelAssigned toNone=>dziegel
    Wed 26 Jul 2017 04:54:16 PM UTCdziegelStatusNone=>Ready For Test

    Back to the top


    Powered by Savane 3.1-cleanup1