Skip to content

Drop received packets whose LoRa header says no CRC in RadioLib override - #3739

Merged
ripplebiz merged 1 commit into
meshcore-dev:devfrom
A13xB0:fix/rx-header-no-crc
Oct 31, 2026
Merged

ripplebiz merged 1 commit into
meshcore-dev:devfrom
A13xB0:fix/rx-header-no-crc

Conversation

@A13xB0

@A13xB0 A13xB0 commented Oct 30, 2026 •

Copy link
Copy Markdown

If a packet's LoRa header says it carries no CRC, the radio checks nothing and reports a good packet, so a corrupted payload is repeated as a new packet that nobody can decrypt. RadioLib's readData() rejects this on SX127x (SX127x.cpp: "most likely damaged packet header")

Example

On the ScotMesh mesh, 97damaged copies in two weeks had bytes changed in the body, which should have failed the CRC. One of them, a Public message with 9 bits changed in payload bytes 8, 10 and 26.

Genuine, 16 October 00:19:39 (packet):

150b695dc1b1203372f6193fca117bc35395876ac687bb89a2529a584ef8319541f638daf022513aee3fcdea2676dd8c0ad6a3474909593d269b517eab5dce31

Damaged copy, 38 seconds later (packet):

151e695dc13ca67bb791b99ad5bb13b75504f09c9125928220337231f619a242117bc35395876ac667bb39a2529a584ef8319541f638daf02251daee3fcdea2676dd8c0ad6a3474909593d269b517eab5dce31

Testing

I tested this in MeshBench with an emulated SX1262. A repeater handed that damaged copy with a "no CRC" header forwarded it on stock dev and dropped it with this change

PS

This should probably be fixed in RadioLib but for now using the Custom Radio Classes will do as overrides.

Also I think this is could be the cause for #1386

TLDR: As MeshCore sets CRC on with all radio varients. This forces it to stay on when received as if its off its corruption anyway. The theory is the CRC on bit gets flipped in the LoRa header (on weak links due to corruption). Explains #1386 and the packet above. It is not very common though.

@A13xB0 A13xB0 changed the title radiolib: drop received packets whose LoRa header says no CRC Drop received packets whose LoRa header says no CRC in RadioLib override Oct 30, 2026
@ripplebiz

Copy link
Copy Markdown
Member

Good stuff.

@ripplebiz
ripplebiz merged commit e8202db into meshcore-dev:dev Oct 31, 2026
15 checks passed
@captinjack99

Copy link
Copy Markdown

The testing above was on an emulated SX1262, so here's what it looks like on real hardware. I've had this change running on two Seeed SenseCAP Solar nodes (SX1262) since the evening of Nov 30, built from dev at 779d916 with the 0x08B5 gain fix turned on, on the US preset.

Over about 15 hours they received 3,162 and 2,494 packets, with recv_errors at 55 and 40. A rejected "no CRC" header is counted in recv_errors along with ordinary CRC failures, so those are an upper bound on what the check threw away.

It doesn't seem to cost any good traffic. One of my Pi-based repeaters hears both nodes directly and logs which of its forwarded floods it hears them repeat. Before the update, on 1.18.0, one of them repeated 4,025 of 4,997 (80.5%) over about 2.8 days. Overnight on dev with this change it was 660 of 831 (79.4%), and the other node 681 of 864 (78.8%). That gap is inside the noise for counts this size.

I haven't caught a damaged-header packet in the act, so this only shows the check stays out of the way on hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants