nimble/ll: Fix handling LL_PHY_UPDATE_IND as a master
We should response with LL_UNKNOWN_RSP
This should fix LL/PAC/MAS/BV-01
@@ -890,8 +890,10 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
*
* @param connsm
* @param dptr
+ *
+ * @return uint8_t
*/
-static void
+static uint8_t
ble_ll_ctrl_rx_phy_update_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
{
int no_change;
@@ -902,7 +904,10 @@ ble_ll_ctrl_rx_phy_update_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
uint16_t instant;
uint16_t delta;
- if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+ if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+ return BLE_LL_CTRL_UNKNOWN_RSP;
+ }
+
/*
* Reception stops the procedure response timer but does not
* complete the procedure
@@ -956,11 +961,12 @@ ble_ll_ctrl_rx_phy_update_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
connsm->phy_instant = instant;
CONN_F_PHY_UPDATE_SCHED(connsm) = 1;
}
- return;
+ return BLE_ERR_MAX;
}
ble_ll_ctrl_phy_update_proc_complete(connsm);
- }
+
+ return BLE_ERR_MAX;
}
#endif
@@ -2426,7 +2432,7 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
rsp_opcode = ble_ll_ctrl_rx_phy_rsp(connsm, dptr, rspdata);
break;
case BLE_LL_CTRL_PHY_UPDATE_IND:
- ble_ll_ctrl_rx_phy_update_ind(connsm, dptr);
+ rsp_opcode = ble_ll_ctrl_rx_phy_update_ind(connsm, dptr);
break;
#endif
default:
