diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index 16c20d7a2..1498bbeab 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -60,6 +60,10 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas } } + if (config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY) { + LOG_DEBUG("Cancelling rebroadcast of message from node on a foreign mesh, due to local only rebroadcast mode\n"); + Router::cancelSending(p->to, p->decoded.request_id); + } // handle the packet as normal Router::sniffReceived(p, c); } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 3961c4ae2..37697bc18 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -160,6 +160,7 @@ void NodeDB::installDefaultConfig() config.has_power = true; config.has_network = true; config.has_bluetooth = true; + config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_ALL; config.lora.sx126x_rx_boosted_gain = false; config.lora.tx_enabled = true; // FIXME: maybe false in the future, and setting region to enable it. (unset region forces it off) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 15bcc1d2a..fc38f9f5e 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -300,6 +300,9 @@ void Router::sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Rout bool perhapsDecode(meshtastic_MeshPacket *p) { + if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER && + config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_ALL_SKIP_DECODING) + return false; if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) return true; // If packet was already decoded just return