* app_rpt: treat an empty "L " linklist update as clearing the stored list
The sender side of the periodic linklist exchange is unconditional: it
always transmits "L " followed by the list, so a peer whose list is
empty sends exactly the two character payload "L ". The receive guard
in handle_link_data() rejected any payload shorter than 3 characters,
so that update was discarded and the last non-empty list a link ever
sent was kept indefinitely. On a permanent link the stale entries are
never freed by rpt_link_destroy(), so nodes two hops away show
phantom connections in RPT_LINKS and "rpt xnode" forever.
Accept the length 2 payload. str + 2 then points at the NUL
terminator and ast_str_set() stores the empty list, which is what the
sender meant. A length 1 payload ("L") is still rejected, so there is
no overrun.
Verified on a four node radioless lab at this tree: with the guard at
< 3 a non-adjacent node still lists a detached transient node at
t+240s; with < 2 the entry clears within one linkpost cycle (~20s).
Swapping the stock module back reproduces the ghost.
Fixes #1209
* app_rpt: remove unused linklistreceived struct member
time_t linklistreceived is declared in struct rpt_link but never
written or read anywhere in the tree. Remove it, as requested in the
review discussion on #1209.
|
||
|---|---|---|
| .dev | ||
| .devcontainer | ||
| .github/workflows | ||
| apps | ||
| channels | ||
| configs | ||
| include/asterisk | ||
| res | ||
| tests/apps | ||
| utils | ||
| .coderabbit.yaml | ||
| .gitignore | ||
| adminauth.md | ||
| README.md | ||
| rpt_install.sh | ||
app_rpt
AllStarLink app_rpt is the core radio repeater controller module for Asterisk, providing functionality for amateur radio repeaters, links, and nodes. This repository contains the radio interface modules, signaling protocols, and repeater logic used in AllStarLink 3.
What This Does
This code implements:
- Radio interface drivers (USB, serial, USRP, voter)
- Repeater control logic (courtesy tones, timeout, hang time)
- Digital signaling protocols (MDC1200, POCSAG)
- Radio bridging and linking functionality
- Configuration management and CLI commands
- Telemetry and monitoring systems
Repository Structure
app_rpt/
├── apps/ # Core repeater application logic (app_rpt.c)
├──app_rpt/ # Core repeater application logic support files
├── channels/ # Asterisk channel drivers (radio interfaces)
├── configs/ # Configuration files and examples
├── rpt/ # Configuration files and examples for AllStarLink
├── samples/ # Configuration file samples
├── include/ # Shared header files
├── res/ # Asterisk resource modules
├── tests/ # Automated test suite
└── utils/ # Helper utilities and tuning tools
Debugging and Submitting Bugs
Feel free to open an issue for any trouble you might be experiencing with these modules. Please try to adhere to the following when submitting bugs:
-
Enable debug to reproduce the issue. You can do this by running
core set debug 5 app_rpt(less than or greater than 5 depending on the issue and how chatty the debug log level is). You can also enable debug all the time inasterisk.conf. To get debug output on the CLI, you will need to add thedebuglevel to theconsole =>log file inlogger.conf. A debug log from the CLI in the seconds leading immediately up to the issue should be provided. -
For segfault issues, a backtrace is needed. Use
ast_coredumperto get a backtrace and post the relevant threads fromfull.txt(almost always Thread 1): https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace (you can also runphreaknet backtrace- make sure to adjust the paste duration from 24 hours if you link the paste link) -
Describe what led up to the issue and how it can be reproduced on our end.
-
Any other context that might be helpful in fixing the issue.
Thank you!
Development
First-time Setup
Build
Build instructions can be found in the asl3-asterisk repo: https://github.com/AllStarLink/asl3-asterisk/tree/develop/docs
Coding Standards
- Follow existing code style patterns
- All commits must pass clang-format checks
- Run
codespellbefore submitting changes - Write descriptive commit messages explaining why changes are made
Pre-commit Hooks
Install necessary tools:
sudo apt install clang-format codespell
After installing clang-format and codespell, set up the pre-commit workflow.
From the top level project directory, execute:
./.dev/install-hooks
This will enable coding standards to be checked locally on each commit.
Contributing Pull Requests
- Fork this repository and create a feature branch
- Make focused, logical commits with clear descriptions
- Ensure pre-commit hooks pass locally
- Test your changes with the appropriate test cases
- Open a Pull Request describing the change and motivation
- Address any review feedback
- Once reviewed, the development team will merge the pull request
Installing
Install from source instructions can be found in the asl3-asterisk repo: https://github.com/AllStarLink/asl3-asterisk/tree/develop/docs
Automatic Installation
Updated instructions are in the ASL3-Manual repo at https://github.com/AllStarLink/ASL3-Manual/blob/main/docs/user-guide/install.md