lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #51525] MQTT_OUTPUT_RINGBUF_SIZE validation


From: Vua Hoa
Subject: [lwip-devel] [bug #51525] MQTT_OUTPUT_RINGBUF_SIZE validation
Date: Fri, 21 Jul 2017 06:17:27 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

URL:
  <http://savannah.nongnu.org/bugs/?51525>

                 Summary: MQTT_OUTPUT_RINGBUF_SIZE validation
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: vuahoa07
            Submitted on: Fri 21 Jul 2017 10:17:26 AM UTC
                Category: Contrib
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.0.2

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?51525>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]