mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 02:14:37 +00:00
Check Position Request for Primary Channel (#2638)
Prevents leaking location data to secondary channels. Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
490abdac96
commit
ac9c81f6d1
@ -52,11 +52,22 @@ bool PositionModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
|
|||||||
|
|
||||||
nodeDB.updatePosition(getFrom(&mp), p);
|
nodeDB.updatePosition(getFrom(&mp), p);
|
||||||
|
|
||||||
|
// Only respond to location requests on the channel where we broadcast location.
|
||||||
|
if (channels.getByIndex(mp.channel).role == meshtastic_Channel_Role_PRIMARY) {
|
||||||
|
ignoreRequest = false;
|
||||||
|
} else {
|
||||||
|
ignoreRequest = true;
|
||||||
|
}
|
||||||
|
|
||||||
return false; // Let others look at this message also if they want
|
return false; // Let others look at this message also if they want
|
||||||
}
|
}
|
||||||
|
|
||||||
meshtastic_MeshPacket *PositionModule::allocReply()
|
meshtastic_MeshPacket *PositionModule::allocReply()
|
||||||
{
|
{
|
||||||
|
if (ignoreRequest) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
meshtastic_NodeInfoLite *node = service.refreshLocalMeshNode(); // should guarantee there is now a position
|
meshtastic_NodeInfoLite *node = service.refreshLocalMeshNode(); // should guarantee there is now a position
|
||||||
assert(node->has_position);
|
assert(node->has_position);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user