Merge pull request #906 from a-f-G-U-C/fix900-part2

further fixes for issue 900
1.2-legacy
Sacha Weatherstone 2021-10-28 23:34:18 +11:00 zatwierdzone przez GitHub
commit 093e3e55b9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 20 dodań i 5 usunięć

Wyświetl plik

@ -457,10 +457,19 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p, RxSource src)
p.pos_timestamp, p.time, p.latitude_i, p.longitude_i);
info->position = p;
} else if ((p.time > 0) && !p.latitude_i && !p.longitude_i && !p.pos_timestamp &&
!p.location_source) {
// FIXME SPECIAL TIME SETTING PACKET FROM EUD TO RADIO
// (stop-gap fix for issue #900)
DEBUG_MSG("updatePosition SPECIAL time setting time=%u\n", p.time);
info->position.time = p.time;
} else {
// Be careful to only update fields that have been set by the REMOTE sender
// A lot of position reports don't have time populated. In that case, be careful to not blow away the time we
// recorded based on the packet rxTime
//
// FIXME perhaps handle RX_SRC_USER separately?
DEBUG_MSG("updatePosition REMOTE node=0x%x time=%u, latI=%d, lonI=%d\n",
nodeId, p.time, p.latitude_i, p.longitude_i);

Wyświetl plik

@ -334,9 +334,11 @@ void Router::handleReceived(MeshPacket *p, RxSource src)
if (decoded) {
// parsing was successful, queue for our recipient
if (src == RX_SRC_LOCAL)
printPacket("handleReceived(local)", p);
printPacket("handleReceived(LOCAL)", p);
else if (src == RX_SRC_USER)
printPacket("handleReceived(USER)", p);
else
printPacket("handleReceived(remote)", p);
printPacket("handleReceived(REMOTE)", p);
} else {
printPacket("packet decoding failed (no PSK?)", p);
}

Wyświetl plik

@ -18,11 +18,15 @@ bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, Position *pptr
{
auto p = *pptr;
// If inbound message is a replay (or spoof!) of our own messages, do not process
// If inbound message is a replay (or spoof!) of our own messages, we shouldn't process
// (why use second-hand sources for our own data?)
// FIXME this can in fact happen with packets sent from EUD (src=RX_SRC_USER)
// to set fixed location, EUD-GPS location or just the time (see also issue #900)
if (nodeDB.getNodeNum() == getFrom(&mp)) {
DEBUG_MSG("Ignored an incoming update from MYSELF\n");
return false;
DEBUG_MSG("Incoming update from MYSELF\n");
// DEBUG_MSG("Ignored an incoming update from MYSELF\n");
// return false;
}
// Log packet size and list of fields