diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 5cf8bfa7d..05f47d7f4 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -479,6 +479,11 @@ DecodeState perhapsDecode(meshtastic_MeshPacket *p) LOG_ERROR("Invalid protobufs in received mesh packet id=0x%08x (bad psk?)!", p->id); } else if (decodedtmp.portnum == meshtastic_PortNum_UNKNOWN_APP) { LOG_ERROR("Invalid portnum (bad psk?)!"); +#if !(MESHTASTIC_EXCLUDE_PKI) + } else if (!owner.is_licensed && isToUs(p) && decodedtmp.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) { + LOG_WARN("Rejecting legacy DM"); + return DecodeState::DECODE_FAILURE; +#endif } else { p->decoded = decodedtmp; p->which_payload_variant = meshtastic_MeshPacket_decoded_tag; // change type to decoded