v1.0.7: Fix LocalTcpInterface mode — AP→GATEWAY to allow announce rebroadcasts

MODE_ACCESS_POINT unconditionally blocks announce broadcasts in
Transport::outbound(), preventing local TCP clients from discovering
each other. Changing to MODE_GATEWAY allows announces to flow through
send_outgoing() which broadcasts to all connected clients.

Root cause: receiver's announce was stored in announce_table but never
rebroadcast on LocalTcpInterface, so sender could never find a path.
This commit is contained in:
James L
2026-02-27 16:38:10 -05:00
parent 8184000d17
commit 59784a34fd
8 changed files with 3680 additions and 3 deletions

View File

@@ -693,7 +693,11 @@ void setup() {
HEAD("Boundary Mode: TCP backbone DISABLED", RNS::LOG_TRACE);
}
// Register local TCP server if enabled (MODE_ACCESS_POINT — no announce forwarding)
// Register local TCP server if enabled
// MODE_GATEWAY allows announce rebroadcasts so local TCP clients
// can discover each other and receive backbone announces.
// (MODE_ACCESS_POINT blocks all announce broadcasts in outbound(),
// which prevented local clients from finding paths to each other.)
if (boundary_state.wifi_enabled && boundary_state.ap_tcp_enabled) {
local_tcp_interface_ptr = new TcpInterface(
TCP_IF_MODE_SERVER,
@@ -706,12 +710,12 @@ void setup() {
// to prevent unnecessary reconnection cycles that leak lwIP memory
local_tcp_interface_ptr->setReadTimeout(600000);
local_tcp_rns_interface = local_tcp_interface_ptr;
local_tcp_rns_interface.mode(RNS::Type::Interface::MODE_ACCESS_POINT);
local_tcp_rns_interface.mode(RNS::Type::Interface::MODE_GATEWAY);
RNS::Transport::register_interface(local_tcp_rns_interface);
{
char _bm_msg[128];
snprintf(_bm_msg, sizeof(_bm_msg), "Local TCP server: port %d (ACCESS_POINT mode)",
snprintf(_bm_msg, sizeof(_bm_msg), "Local TCP server: port %d (GATEWAY mode)",
boundary_state.ap_tcp_port);
HEAD(_bm_msg, RNS::LOG_TRACE);
}