[yencode] Fix an unlikely bug that may trigger packet loss pattern detection in D-Star #303
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.
Hi team,
Per D-Star specification, section 6.2, our output shall be escaped so that the pattern
0xE7, 0x84, 0x76never appears in a DV Slow data packet. This is because it might trigger the packet loss logic if combined with the silence pattern in the voice section:This PR is a change proposal to patch that unlikely bug.
Unlike what is recommended in section 6.2, the easiest way to ensure we don't trigger aforementioned the packet loss mechanisms would be to either add
0x76or0x84to the list of banned characters (0xE7is a reserved DV Slow data miniheader value, escaping it may still make the bug viable in the future).If you are willing to stick to the standard by the letter, at the price of a higher overhead, please free to edit that PR to add
0xE7and0x76to the banned list (on a side note, none of the 3 characters become a banned character once escaped).Unpatched implementations are forward compatible with this change, since yDecoding doesn't rely on the banned character list to unescape characters.
Best regards,