buglwIP - A Lightweight TCP/IP stack - Bugs: bug #66883, LWIP sent out MQTT package with 7...

 
 

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

bug #66883: LWIP sent out MQTT package with 7 bytes wrong data in MQTT header.

Submitter:  Polo-Jiang <polo_jiang1>
Submitted:  Sat 08 Mar 2025 04:15:17 AM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  2.1.2

Sat 08 Mar 2025 04:15:17 AM UTC, original submission:  

Hi Team,

I am working for a network device which run freeRTOS and using lwip-2.1.2 as TCPIP stack, the device support MQTT client, and will periodly upload device-port-status to MQTT server in internet, the MQTT package tx and rx are with lwip too.

And I meet a problem which is low-frequently happened, I guess, one time in 2 hours. one of the port-status upload MQTT package is with wrong MQTT topic. when the problem happens, we can use wireshark to analyze the captured package and found the bad package is "malformed package".


The MQTT head format is:
head flag
   msg-len
topic-len
               /  T  E  G  2 ... ...
30 b5 0a 00 39 2f 54 45 47 32

but in wrong package, it looks the first 7 bytes are wrong:
4  a  3  5  "  }     E  G  2
34 61 33 35 22 7d 00 45 47 32

and the problem happens 3 times, in each time the wrong data are 7 bytes in MQTT header, the same place, the wrong content is with "xxxx"} " format. yes, you can guess that, the MQTT content is a json format.

I debugged in MQTT package constructing, and found the MQTT package is good, but when it is sent out by lwip and the wireshark captured it from internet by mirror port, we can see the MQTT head is changed and with wrong data.

I am not sure if that is a known issue or not, so I post my problem here and I am appreciated for any helps and clues.


Polo-Jiang <polo_jiang1>

 

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

Attached Files
file #56982:  lwip_issue_wrong_package1.jpg added by polo_jiang1 (673KiB - image/jpeg - I uploaded 3 pictures for captured frame. the first 2 are for bad package and the last one is for good package with correct data as reference.)
file #56983:  lwip_issue_wrong_package2.jpg added by polo_jiang1 (616KiB - image/jpeg - I uploaded 3 pictures for captured frame. the first 2 are for bad package and the last one is for good package with correct data as reference.)
file #56984:  lwip_issue_good_package.jpg added by polo_jiang1 (467KiB - image/jpeg - I uploaded 3 pictures for captured frame. the first 2 are for bad package and the last one is for good package with correct data as reference.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by polo_jiang1 (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-03-08 polo_jiang1 Attached File- Added lwip_issue_wrong_package1.jpg, #56982
        Attached File- Added lwip_issue_wrong_package2.jpg, #56983
        Attached File- Added lwip_issue_good_package.jpg, #56984

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code