Commit Graph
22 Commits
Author SHA1 Message Date
liquidraver 2ad185bab4 license "refactor" :) 2026-06-07 22:47:17 +02:00
liquidraver ec982ca15f fix(dispatcher): wake the loop for zero-delay sends
Companion BLE/USB direct & zero-hop sends enqueue with delay 0 from
sysworkq, off the main loop. Since 57b971f dropped the per-frame RX
wake, fire the tx-queued callback for delay 0 too so they actually
drain (USB companion has no tx-idle backstop and would stall).
2026-05-31 15:36:41 +02:00
liquidraver 7d7a64ff5a fix: airtime LDRO threshold must track driver (was BW-blind sf>=11)
getEstAirtimeFor() set LDRO from `sf >= 11`, correct only at BW125. Now
matches the driver's should_enable_ldro() (t_sym > 16.38 ms) so the
estimate's DE tracks hardware DE on every SF/BW. Also drop dead
calcRxDelay() + unused MAX_RX_DELAY_MILLIS.
2026-05-29 15:48:48 +02:00
liquidraver b1f1c77b88 simplify packet manager and dispatcher 2026-05-29 09:09:00 +02:00
liquidraver bd1e022e88 fix(security): close OOB read in path-decoding callers (BLE + LoRa-anon)
Both mesh::Packet::writePath and ::copyPath did a raw memcpy of the
decoded hash_count*hash_size bytes from src to dest with no bound on
src. Two call sites used phone-supplied or LoRa-anon-supplied buffers
where the path_len byte was attacker-controlled:

  - CompanionMesh CMD_SEND_CHANNEL_DATA accepted len>=4 and called
    writePath with no src bound; a paired phone could leak up to ~65
    bytes of syswq stack into the outgoing LoRa channel-data frame.

  - RepeaterMesh handleAnonRegionsReq / handleAnonOwnerReq /
    handleAnonClockReq read reply_path_len from an unauthenticated
    LoRa anon-request payload and called copyPath without any src
    bound. Any LoRa neighbor could leak repeater stack into the
    reply path.

Hardened the API: both functions now require an explicit src_len
and reject (return 0) when the decoded byte count exceeds it.
Updated all 14 call sites across Packet/Mesh/Dispatcher/BaseChatMesh/
CompanionMesh/RepeaterMesh. Trusted callers (internal MAX_PATH_SIZE
buffers) pass MAX_PATH_SIZE; untrusted callers pass real remaining
length. Added len-5 plumbing through the anon-handler signatures.

CMD_SEND_CHANNEL_DATA also gained a local len>=5 + path_bytes
sanity check for early rejection.
2026-05-20 11:52:39 +02:00
liquidraver 3441caf8b0 new rx busy latch 2026-05-14 22:24:48 +02:00
liquidraver 6919c3511c rx_boost state is undefined at boot (minor fix)
every LBT-retried flood packet loses its priority (fixed)
witching between LBT and non-LBT mode (or any cad.mode change) could silently skip full reconfiguration and leave the radio in the wrong mode (fixed)
2026-05-08 09:50:52 +02:00
liquidraver ee2990fd16 hwconfig failsafe and duty cycle 10/6->10/4 (tests showed better reception) 2026-05-05 10:46:58 +02:00
liquidraver a81f27aea4 implement "isradioready" for early returns in rx duty cycling 2026-04-30 21:54:59 +02:00
liquidraver 1092c49a7d port vanilla duty cycling logic 2026-04-28 14:43:12 +02:00
liquidraver 7876ae79c3 make CAD retry jittery, sync prefs load to companion-style 2026-04-18 22:21:57 +02:00
liquidraver 0e5e71563c logging cleanup 2026-03-29 09:51:53 +02:00
liquidraver 33fa19a7f5 comment overhaul 2026-03-28 20:53:59 +01:00
liquidraver 3bec5fedb9 agc reset fix 2026-03-15 13:49:13 +01:00
liquidraver d45fbf7027 reactive collision avoidance 2026-03-11 12:08:48 +01:00
liquidraver a4e96fa6e6 separate main events from housekeeping ones 2026-03-04 21:08:21 +01:00
liquidraver 9b6a47d27b port multibyte paths 2026-02-26 15:40:51 +01:00
liquidraver 7370356ae0 log fixes 2026-02-26 14:36:31 +01:00
liquidraver f3afb6433d rework tx cad 2026-02-22 18:39:49 +01:00
liquidraver 1332df0461 future-proof lora rx queue 2026-02-22 15:19:03 +01:00
liquidraver b6bc46b921 ESP OTA first implementation 2026-02-22 13:09:18 +01:00
liquidraver 8d1823d0b6 First iteration that seems to work 2026-02-20 12:43:13 +01:00