-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Malformed packet error at connection time when QOS level is 1 (At least once) and MQTT version 3.1 #2522
Comments
The problem is with the first byte of the message (labelled by wireshark as "Header flags"). The one that's failing has 0x12, but this is invalid -- there are no flags defined for CONNECT, so the only valid control byte for a connect message is 0x10. Mosquitto closes the connection as required by the spec (section 2.2.2 "If invalid flags are received, the receiver MUST close the Network Connection"). |
Thanks a lot for your time and answer! The problem here is with MQTT version 3.1. Reading the specification (cf. https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#connect from https://mqtt.org/mqtt-specification/ link), it is not invalid to have header flags set as they are not used in the CONNECT message (see section 3.1. CONNECT - Client requests a connection to a server / Fixed header). For CONNECT message, Mosquitto should simply ignore them and allow connection anyway. This is the behaviour of Mosquitto version 1.3.5. |
I'm afraid the MQTT 3.1 specification leads to interpretation. The section 2.6 uses "should" and not "must", which does not have the same meaning in RFC key words. Is there any chance to see a fix for this issue to match the behaviour of Mosquitto version 1.3.5 (issue does not appear with this version)? |
@ralight The same problem I have with the publish command with an MQTT Client V3.1.1 to Mosquitto Broker V2.0.14, when QOS=1, with the Ack: Frame 21861: 134 bytes on wire (1072 bits), 134 bytes captured (1072 bits) on interface \Device\NPF_Loopback, id 0 Frame 21865: 46 bytes on wire (368 bits), 46 bytes captured (368 bits) on interface \Device\NPF_Loopback, id 0 Set QOS=0 at publish, it is accepted by the Mosquitto Broker V2.0.14. |
Environment
Describe the bug
Expected behaviour
Remarks
Analysis
The text was updated successfully, but these errors were encountered: