Repository navigation
Only process/forward MAVLink messages which pass frame check - #3679
Merged
Merged
Conversation
pkendall64
approved these changes
Jun 24, 2026
mha1
approved these changes
Jun 24, 2026
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.
Adds a check to incoming and forwarded MAVLink messages to verify they pass CRC and framing requirements before using them.
Details
mavlink_frame_char()returns non-zero any time there is a possible message, including those with bad CRCs or framing characters. Our code takes both of these cases as "good message received" indicators and parse them or forward them to external systems. I believe this can cause output spam to Ardupilot and blow out their receive buffer with garbage until the stream coming OTA resyncs to a valid packet. A user reported this and I suggested this change, after which they tried to PR it and then ghosted me. 👻We previously (4.0 RC) ran into this problem with force-switching to MAVLink mode on virtually any USB serial input due to how loosely the underlying parser would return that these were MAVLink messages* ("But I said they were invalid messages!!").
I think it is the right thing to do to verify the CRC/Framing before acting on them, like we do with CRSF.