mesh: Ignore Friend Request from local interface

Friend Request is also transmitted over local queue and
if both Friend and LPN features are enabled then we would
try to establish friendship with ourselves.

Fixes MESH/NODE/FRND/LPN testcases.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
This commit is contained in:
Michał Narajowski 2020-06-24 12:53:13 +02:00 committed by Johan Hedberg
commit 91761767dd

View file

@ -905,6 +905,11 @@ int bt_mesh_friend_req(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf)
uint32_t poll_to;
int i;
if (rx->net_if == BT_MESH_NET_IF_LOCAL) {
BT_DBG("Ignoring Friend request from local interface");
return 0;
}
if (buf->len < sizeof(*msg)) {
BT_WARN("Too short Friend Request");
return -EINVAL;