Fix #3613: Use 0x81 Malformed Packet for invalid DISCONNECT flags - #3642
Open
mustafaabdullahk wants to merge 10 commits into
Open
Fix #3613: Use 0x81 Malformed Packet for invalid DISCONNECT flags#3642mustafaabdullahk wants to merge 10 commits into
mustafaabdullahk wants to merge 10 commits into
Conversation
Closes eclipse-mosquitto#3447. Thanks to JurgenLB
Closes eclipse-mosquitto#3455. Thanks to FelixPopp.
Closes eclipse-mosquitto#3452. Thanks to yuyiming-visn
This was incorrectly added in the fix for eclipse-mosquitto#3455. Closes eclipse-mosquitto#3475. Thanks to Manuel Janocha
Closes eclipse-mosquitto#3503. Thanks to Julian Graf.
Closes eclipse-mosquitto#3344. Thanks to Joachim Zobel.
This occured if a client set session-expiry-interval=0 when using will-delay-interval>0. Closes eclipse-mosquitto#3505. Thanks to Julian Graf.
…CONNECT flags Signed-off-by: Mustafa Abdullah Kus <mabdkus@hotmail.com>
Author
|
Hi everyone, just a gentle ping to see if a maintainer could approve the CI workflow execution for this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.