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

Submitter:  Vua Hoa <vuahoa07>
Submitted:  Fri 21 Jul 2017 10:17:26 AM UTC
   
 
Category:  Contrib Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  dziegel
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group 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>

 

(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 dziegel (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by vuahoa07 (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-27 dziegel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-07-26 dziegel Assigned toNone dziegel
    2017-07-26 dziegel StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code