Skip to content

Bluetooth: Mesh: Friend node Adding another Friend Update #20746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LingaoM opened this issue Nov 16, 2019 · 2 comments · Fixed by #21026
Closed

Bluetooth: Mesh: Friend node Adding another Friend Update #20746

LingaoM opened this issue Nov 16, 2019 · 2 comments · Fixed by #21026
Assignees
Labels
area: Bluetooth Mesh area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@LingaoM
Copy link
Collaborator

LingaoM commented Nov 16, 2019

Two friend update message are required in the MESH/NODE/FRND/FN/BV-20-C [Adding another Friend Update – Friend Node], but I did not find such processing logic in the code. But it's strange that I noticed that I have passed the certification ?

In the authentication process, it is required that the first friend_update message should be MD = 1,
Only in this case enqueue_update(frnd, 1);
I tracked the process: enqueue_update(frnd, 1); <--- enqueue_friend_pdu;

However enqueue_friend_pdu will not be called at this stage.

If I'm right, the problem is this function bt_mesh_friend_sec_update:

void bt_mesh_friend_sec_update(u16_t net_idx)
{
int i;
BT_DBG("net_idx 0x%04x", net_idx);
for (i = 0; i < ARRAY_SIZE(bt_mesh.frnd); i++) {
struct bt_mesh_friend *frnd = &bt_mesh.frnd[i];
if (frnd->net_idx == BT_MESH_KEY_UNUSED) {
continue;
}
if (net_idx == BT_MESH_KEY_ANY || frnd->net_idx == net_idx) {
frnd->sec_update = 1U;
}
}
}

If the flag [frnd->sec_update]is true before we set it, it is obvious that the last friend_update will be lost.

@aescolar
Copy link
Member

CC @trond-snekvik @jhedberg

@LingaoM
Copy link
Collaborator Author

LingaoM commented Nov 25, 2019

+70516 ms
Verdict Description: Send Friend Poll. Friend Sequence Number = 1

+70532 ms
Send Event: HCI!HCI_LE_SET_ADVERTISING_DATA{
advertisingDataLength=0x15,
advertisingData=0x142A633A636838138218FDA9B2992B453E26792E49000000000000000000
}

+70532 ms
Receive Event: HCI?HCI_LE_SET_ADVERTISING_DATA_COMPLETE_EVENT{
status=HCI_OK
}

+70532 ms
Send Event: HCI!HCI_LE_SET_ADVERTISE_ENABLE{
advertisingEnable=HCI_LE_ADVERTISING_ENABLE
}

+70532 ms
Receive Event: HCI?HCI_LE_SET_ADVERTISE_ENABLE_COMMAND_COMPLETE_EVENT{
status=HCI_OK
}

+70547 ms
Send Event: HCI!HCI_LE_SET_ADVERTISE_ENABLE{
advertisingEnable=HCI_LE_ADVERTISING_DISABLE
}

+70547 ms
Receive Event: HCI?HCI_LE_SET_ADVERTISE_ENABLE_COMMAND_COMPLETE_EVENT{
status=HCI_OK
}

+70563 ms
Verdict Description: Wait for friend message.

+70563 ms
Verdict Description: ***** Waiting for: MeshTransport Event

+70766 ms
Verdict Description: Received Msg: MeshTransport EventTransport Message:
Op Code: [2 (0x02)] FriendUpdate
KeyRefreshFlag: [0x01]
IVUpdateFlag: [0x01]
FlagReserved: [0x00]
IVIndex: [3 (0x00000003)]
MD: [0 (0x00)]transport header Transport Header:
TransOpCode: [0x02]
SEG: [0x00]MeshNetworkData:: MeshNetwork Network Header:
NID: [0x22]
IVI: [0x00]
TTL: [0x00]
CTL: [0x01]
SEQ: [0x000108]
SRC: [0x0033]
DST: [0x0035]
TransportPDU: [0x02030000000300]

+70766 ms
Verdict Description: ApplicationLayer Poll receive payload empty.

+70782 ms
Verdict Description: Wait for friend message.

+70782 ms
Verdict Description: ***** Waiting for: MeshTransport Event

+70782 ms
Verdict Description: ***** Waiting for: MeshTransport Event

+71078 ms
Verdict Description: FriendUpdate Command params: keyRefreshFlag = 1, ivUpdateFlag =1, IV Index = 0x00000003, MD = 0

+74078 ms
Verdict Description: Send Friend Poll. Friend Sequence Number = 0

+74094 ms
Send Event: HCI!HCI_LE_SET_ADVERTISING_DATA{
advertisingDataLength=0x15,
advertisingData=0x142A6311511E8ED9E79A0C80FCD27ED76E7450AF0B000000000000000000
}

+74094 ms
Receive Event: HCI?HCI_LE_SET_ADVERTISING_DATA_COMPLETE_EVENT{
status=HCI_OK
}

+74094 ms
Send Event: HCI!HCI_LE_SET_ADVERTISE_ENABLE{
advertisingEnable=HCI_LE_ADVERTISING_ENABLE
}

+74094 ms
Receive Event: HCI?HCI_LE_SET_ADVERTISE_ENABLE_COMMAND_COMPLETE_EVENT{
status=HCI_OK
}

+74110 ms
Send Event: HCI!HCI_LE_SET_ADVERTISE_ENABLE{
advertisingEnable=HCI_LE_ADVERTISING_DISABLE
}

+74110 ms
Receive Event: HCI?HCI_LE_SET_ADVERTISE_ENABLE_COMMAND_COMPLETE_EVENT{
status=HCI_OK
}

+74125 ms
Verdict Description: Wait for friend message.

+74125 ms
Verdict Description: ***** Waiting for: MeshTransport Event

+75141 ms
Verdict Description: Timeout to get response on Friend Poll message.

+75438 ms
Verdict Description: Timeout!!!

+75438 ms
Inconclusive: Failed to receive Friend Update message with IV Update flag set to 1.

+75438 ms
Verdict Description: Failed to receive Friend Update message with IV Update flag set to 1.

+75438 ms
Verdict Description: ***** Waiting for: MeshTransport Event

+76453 ms
Send Event: HCI!HCI_LE_SET_SCAN_ENABLE{
leScanEnable=HCI_LE_SCAN_DISABLE,
filterDuplicates=HCI_LE_DUPLICATE_FILTERING_DISABLE
}

+79016 ms
Final Verdict: INCONC

@joerchan joerchan added area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug labels Dec 2, 2019
jhedberg pushed a commit that referenced this issue Dec 14, 2019
Fixes: #20746

According MESH/NODE/FRND/FN/BV-20-C should add another
Friend Update.

Signed-off-by: Lingao Meng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Mesh area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants