mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 11:55:56 +00:00
Extra check on UDP packets
This commit is contained in:
parent
2b97576b18
commit
de5b55921e
@ -44,7 +44,7 @@ class UdpMulticastHandler final
|
|||||||
meshtastic_MeshPacket mp;
|
meshtastic_MeshPacket mp;
|
||||||
LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength);
|
LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength);
|
||||||
bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp);
|
bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp);
|
||||||
if (isPacketDecoded && router) {
|
if (isPacketDecoded && router && mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag) {
|
||||||
UniquePacketPoolPacket p = packetPool.allocUniqueCopy(mp);
|
UniquePacketPoolPacket p = packetPool.allocUniqueCopy(mp);
|
||||||
// Unset received SNR/RSSI
|
// Unset received SNR/RSSI
|
||||||
p->rx_snr = 0;
|
p->rx_snr = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user