mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Fix #3613: Use 0x81 Malformed Packet for invalid DISCONNECT flags

Open mustafaabdullahk opened this issue 6 months ago • 1 comments

Description of Changes

What:

Modified src/handle_disconnect.c to return MOSQ_ERR_MALFORMED_PACKET instead of MOSQ_ERR_PROTOCOL when invalid reserved bits are detected in the DISCONNECT fixed header.

Why:

This change ensures compliance with the MQTT 5.0 Specification (Section 3.14.1), which states that invalid fixed-header flags for a DISCONNECT packet MUST be classified as a Malformed Packet (Reason Code 0x81).

Prior to this fix, Mosquitto was incorrectly returning 0x82 (Protocol Error), as identified in issue #3613.

mustafaabdullahk avatar May 07 '26 08:05 mustafaabdullahk

Hi everyone, just a gentle ping to see if a maintainer could approve the CI workflow execution for this PR?

mustafaabdullahk avatar May 19 '26 09:05 mustafaabdullahk