mosquitto
mosquitto copied to clipboard
Fix #3613: Use 0x81 Malformed Packet for invalid DISCONNECT flags
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.
Hi everyone, just a gentle ping to see if a maintainer could approve the CI workflow execution for this PR?