Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

No limit on how late a queued FLOOD packet can be sent, so a delayed packet can re-flood the mesh

Open
#3,562 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
networking

Research direction

Start with Dispatcher::checkSend(), PacketQueue::get(), and Mesh::routeRecvPacket() to trace how queued FLOOD packets are prioritized and sent. Then inspect PacketManager and StaticPoolPacketManager for the removal path, and the native gtests described in the issue for coverage. Done means overdue FLOOD packets are dropped at the configured limit, DIRECT packets remain unaffected, and the starvation scenario is covered.

Written by the indexing model from the issue text.

Description

Related to #2133 (auto-closed as stale), where several meshes reported old public-channel messages reappearing with the same packet hash and original timestamp.

Behaviour

Two behaviours combine:

  1. The duplicate table only remembers recent packets. SimpleMeshTables holds the last 160 packet hashes (MAX_PACKET_HASHES), with no time component. On a busy mesh it can refill within minutes.
  2. The outbound queue has no age limit. PacketQueue::get() always sends the highest-priority due packet first. Flood re-sends use priority = hop count (Mesh::routeRecvPacket), and direct/routed traffic is priority 0. Under sustained higher-priority traffic, plus airtime-budget and CAD waits, a long-path flood can be held well past its scheduled time. Nothing caps how late it can go out.

If a delayed flood goes out after neighbours have forgotten its hash, they treat it as new and flood it across the mesh again with a normal-looking path. loop.detect doesn't catch this.

How this relates to #2133

Realistically, this produces delays of seconds to minutes, not hours, because the queue has only 32 slots. So it probably doesn't explain the 2–3 hour reports in #2133 by itself. Those may involve an external replay, e.g. a bridge or IP backhaul that buffers raw packets. Still, nothing in the queue limits how late a flood can be sent, and that seems worth closing off.

Proposed change

Before each send attempt, Dispatcher::checkSend() drops any queued FLOOD packet whose scheduled send time is more than MAX_FLOOD_TX_OVERDUE_MILLIS (default 60 s) in the past.

  • Can be set at build time (-D MAX_FLOOD_TX_OVERDUE_MILLIS=...) or per node by overriding getMaxFloodTxOverdue(). 0 disables it.
  • DIRECT packets are not affected.
  • New PacketManager::removeOverdueFlood(), which does nothing by default so other PacketManager implementations still compile. StaticPoolPacketManager implements it.
  • Native gtest coverage for the queue function and for Dispatcher, using a fake radio and clock, including a starvation scenario. Dispatcher.cpp is now part of the native test build.

Branch: fix/expire-stale-outbound-floods. I'm happy to adjust the default limit or make it a CLI pref (e.g. set flood.max.delay) if preferred

Dominant language
C
Stars
3.9k
Forks
1.5k
Avg merge
1d 1h
Merged PRs (30d)
26

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from meshcore-dev/MeshCore

All issues in meshcore-dev/MeshCore

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.