Skip to content
Commit fa5503fb authored by Michael Scott's avatar Michael Scott Committed by Jukka Rissanen
Browse files

net/mqtt: use rlen to calculate # of QoS items in SUBACK packet



The data->len of an inbound netbuf can be larger than a single
MQTT packet.  For instance when a PINGRESP is also included
in the same netbuf.  For this reason we should not be using
the data->len to determine how large the rest of the MQTT data is.

Specific Example: we've seen in testing that PINGRESP packets
can be included with a SUBACK packet in the same netbuf. Under
this case the current code uses the data->len incorrectly and
tries to find 3 QoS elements for the SUBACK packet when there
is only 1 (the rest of the data is for PINGRESP).

NOTE: A larger patch to iterate through the netbuf data parsing
individual MQTT packets will be needed to fix the MQTT subsys.
This patch only corrects the SUBACK parsing.

Change-Id: I7f6cebaaed9570b778d466de84331cf8c5060755
Signed-off-by: default avatarMichael Scott <michael.scott@linaro.org>
parent e5f1112b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment