!6231 fix TrySendJoinLNNRequest overlenth

Merge pull request !6231 from shen_panda/fix/0524
This commit is contained in:
openharmony_ci 2024-05-27 04:19:19 +00:00 committed by Gitee
commit dc4059ccc6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -623,6 +623,12 @@ static void DfxRecordLnnAuthStart(const AuthConnInfo *connInfo, const JoinLnnMsg
LNN_EVENT(EVENT_SCENE_JOIN_LNN, EVENT_STAGE_AUTH, extra);
}
static bool IsConnFsmFlagOnline(LnnConnectionFsm *connFsm, bool needReportFailure)
{
connFsm->connInfo.flag |= (needReportFailure ? LNN_CONN_INFO_FLAG_JOIN_REQUEST : LNN_CONN_INFO_FLAG_JOIN_AUTO);
return (connFsm->connInfo.flag & LNN_CONN_INFO_FLAG_ONLINE) != 0;
}
static int32_t TrySendJoinLNNRequest(const JoinLnnMsgPara *para, bool needReportFailure, bool isShort)
{
int32_t ret = SOFTBUS_OK;
@ -643,8 +649,7 @@ static int32_t TrySendJoinLNNRequest(const JoinLnnMsgPara *para, bool needReport
SoftBusFree((void *)para);
return ret;
}
connFsm->connInfo.flag |= (needReportFailure ? LNN_CONN_INFO_FLAG_JOIN_REQUEST : LNN_CONN_INFO_FLAG_JOIN_AUTO);
if ((connFsm->connInfo.flag & LNN_CONN_INFO_FLAG_ONLINE) != 0) {
if (IsConnFsmFlagOnline(connFsm, needReportFailure)) {
if (connFsm->connInfo.addr.type == CONNECTION_ADDR_WLAN || connFsm->connInfo.addr.type == CONNECTION_ADDR_ETH) {
char uuid[UUID_BUF_LEN] = {0};
(void)LnnConvertDlId(connFsm->connInfo.peerNetworkId, CATEGORY_NETWORK_ID, CATEGORY_UUID,