Release the opaque relay copy the interface declines to send - #11262
Conversation
relayOpaquePacket() allocates a copy and returns Router::send(relay) == ERRNO_OK, discarding ERRNO_SHOULD_RELEASE. The interface returns that for NODENUM_BROADCAST_NO_LORA, so the copy is never freed and one pool slot leaks per frame. The opaque path is reached for packets on a channel we have no key for, so no key or PSK is needed: a frame with an unknown channel hash, to=NODENUM_BROADCAST_NO_LORA, a nonzero id and hop_limit>0 leaks a slot, and roughly MAX_PACKETS of them exhaust the pool until reboot. #11087 fixed this pattern in perhapsRebroadcast and the retransmission paths but did not cover relayOpaquePacket, which was added separately with the opaque relay path.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesOpaque packet relay cleanup
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Try this PR in the Web FlasherNote Building this pull request… the flash button, badges and supported-board |
relayOpaquePacket()allocates a copy and returnsRouter::send(relay) == ERRNO_OK, discarding ERRNO_SHOULD_RELEASE. The interface returns that for NODENUM_BROADCAST_NO_LORA (RadioLibInterface.cpp), so the copy is never freed and one pool slot leaks per frame.The opaque path is taken when
passesRoutingAuthGatereturns OPAQUE_RELAY_ONLY, which is the verdict for a packet on a channel we hold no key for. No key, PSK or admin access is required: a frame with an unknown channel hash,to=NODENUM_BROADCAST_NO_LORA, a nonzero id andhop_limit > 0leaks a slot on every default-configured rebroadcaster, and roughly MAX_PACKETS of them exhaust the pool until reboot.#11087 fixed this same pattern in
perhapsRebroadcastand the retransmission paths, and added the NODENUM_BROADCAST_NO_LORA guard now at NextHopRouter.cpp:180, butrelayOpaquePacketwas not covered.Summary by CodeRabbit