@@ -326,7 +326,7 @@ int SensorMesh::getAGCResetInterval() const {
326326 return ((int )_prefs.agc_reset_interval ) * 4000 ; // milliseconds
327327}
328328
329- uint8_t SensorMesh::handleLoginReq (const mesh::Identity& sender, const uint8_t * secret, uint32_t sender_timestamp, const uint8_t * data) {
329+ uint8_t SensorMesh::handleLoginReq (const mesh::Identity& sender, const uint8_t * secret, uint32_t sender_timestamp, const uint8_t * data, bool is_flood ) {
330330 ClientInfo* client;
331331 if (data[0 ] == 0 ) { // blank password, just check if sender is in ACL
332332 client = acl.getClient (sender.pub_key , PUB_KEY_SIZE);
@@ -359,6 +359,10 @@ uint8_t SensorMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t*
359359 dirty_contacts_expiry = futureMillis (LAZY_CONTACTS_WRITE_DELAY);
360360 }
361361
362+ if (is_flood) {
363+ client->out_path_len = -1 ; // need to rediscover out_path
364+ }
365+
362366 uint32_t now = getRTCClock ()->getCurrentTimeUnique ();
363367 memcpy (reply_data, &now, 4 ); // response packets always prefixed with timestamp
364368 reply_data[4 ] = RESP_SERVER_LOGIN_OK;
@@ -451,7 +455,7 @@ void SensorMesh::onAnonDataRecv(mesh::Packet* packet, const uint8_t* secret, con
451455 data[len] = 0 ; // ensure null terminator
452456 uint8_t reply_len;
453457 if (data[4 ] == 0 || data[4 ] >= ' ' ) { // is password, ie. a login request
454- reply_len = handleLoginReq (sender, secret, timestamp, &data[4 ]);
458+ reply_len = handleLoginReq (sender, secret, timestamp, &data[4 ], packet-> isRouteFlood () );
455459 // } else if (data[4] == ANON_REQ_TYPE_*) { // future type codes
456460 // TODO
457461 } else {
0 commit comments