@@ -82,7 +82,7 @@ void MyMesh::putNeighbour(const mesh::Identity &id, uint32_t timestamp, float sn
8282#endif
8383}
8484
85- uint8_t MyMesh::handleLoginReq (const mesh::Identity& sender, const uint8_t * secret, uint32_t sender_timestamp, const uint8_t * data) {
85+ uint8_t MyMesh::handleLoginReq (const mesh::Identity& sender, const uint8_t * secret, uint32_t sender_timestamp, const uint8_t * data, bool is_flood ) {
8686 ClientInfo* client = NULL ;
8787 if (data[0 ] == 0 ) { // blank password, just check if sender is in ACL
8888 client = acl.getClient (sender.pub_key , PUB_KEY_SIZE);
@@ -123,6 +123,10 @@ uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secr
123123 }
124124 }
125125
126+ if (is_flood) {
127+ client->out_path_len = -1 ; // need to rediscover out_path
128+ }
129+
126130 uint32_t now = getRTCClock ()->getCurrentTimeUnique ();
127131 memcpy (reply_data, &now, 4 ); // response packets always prefixed with timestamp
128132 reply_data[4 ] = RESP_SERVER_LOGIN_OK;
@@ -438,7 +442,7 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m
438442 data[len] = 0 ; // ensure null terminator
439443 uint8_t reply_len;
440444 if (data[4 ] == 0 || data[4 ] >= ' ' ) { // is password, ie. a login request
441- reply_len = handleLoginReq (sender, secret, timestamp, &data[4 ]);
445+ reply_len = handleLoginReq (sender, secret, timestamp, &data[4 ], packet-> isRouteFlood () );
442446 // } else if (data[4] == ANON_REQ_TYPE_*) { // future type codes
443447 // TODO
444448 } else {
0 commit comments