Skip to content

feat: add path.hash.mode.min CLI command for repeaters#2707

Open
StijnBTC wants to merge 2 commits into
meshcore-dev:devfrom
StijnBTC:dev
Open

feat: add path.hash.mode.min CLI command for repeaters#2707
StijnBTC wants to merge 2 commits into
meshcore-dev:devfrom
StijnBTC:dev

Conversation

@StijnBTC
Copy link
Copy Markdown

@StijnBTC StijnBTC commented Jun 6, 2026

Description

Adds a new CLI command path.hash.mode.min to allow repeaters to enforce a minimum path hash size for forwarded flood packets.

Changes

  • Added min_path_hash_mode field to NodePrefs struct for persistence
  • Added CLI handlers for get and set path.hash.mode.min commands
  • Implemented in simple_repeater allowPacketForward() method
  • Updated documentation with usage examples

Behavior

The repeater will drop flood packets with insufficient hash size:

  • 0: No minimum enforced (default, forward all packets)
  • 1: Require hash_size >= 2 bytes (drop mode 0 packets)
  • 2: Require hash_size >= 3 bytes (drop mode 0-1 packets)

Testing

  • Verified build succeeds for (RAK_4631_repeater)
  • Tested CLI commands on RAK 4631
  • Confirmed logic works correctly by testing it with my companion and repeater

@niekvenema
Copy link
Copy Markdown

👍

StijnBTC added 2 commits June 6, 2026 14:10
Add a new CLI setting to enforce minimum path hash size on flood packet forwarding.
Repeaters can now drop flood packets with insufficient hash size using:
  set path.hash.mode.min <0-2>

- 0: no minimum (default, forward all)
- 1: require hash_size >= 2 (drop 1-byte hashes)
- 2: require hash_size >= 3 (drop 1-2 byte hashes)

Implemented in simple_repeater example and persisted to preferences.

Tested and verified on RAK 4631 repeater.
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