From 073b8daa6ee858b1f1f8fbb379671b04cc5903f4 Mon Sep 17 00:00:00 2001 From: lly Date: Mon, 1 Jun 2020 20:26:14 +0800 Subject: [PATCH] ble_mesh: Rework prov pdu length check --- components/bt/esp_ble_mesh/mesh_core/prov.c | 2 +- components/bt/esp_ble_mesh/mesh_core/provisioner_prov.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/prov.c b/components/bt/esp_ble_mesh/mesh_core/prov.c index 446987f2f3..dcd990e29f 100644 --- a/components/bt/esp_ble_mesh/mesh_core/prov.c +++ b/components/bt/esp_ble_mesh/mesh_core/prov.c @@ -1546,7 +1546,7 @@ static void gen_prov_start(struct prov_rx *rx, struct net_buf_simple *buf) if (link.rx.buf->len > link.rx.buf->size) { BT_ERR("%s, Too large provisioning PDU (%u bytes)", __func__, link.rx.buf->len); - /* Zephyr uses prov_send_fail_msg() here */ + prov_send_fail_msg(PROV_ERR_NVAL_FMT); return; } diff --git a/components/bt/esp_ble_mesh/mesh_core/provisioner_prov.c b/components/bt/esp_ble_mesh/mesh_core/provisioner_prov.c index 8b01bb04a1..d385eb7011 100644 --- a/components/bt/esp_ble_mesh/mesh_core/provisioner_prov.c +++ b/components/bt/esp_ble_mesh/mesh_core/provisioner_prov.c @@ -3039,7 +3039,7 @@ static void gen_prov_start(const u8_t idx, struct prov_rx *rx, struct net_buf_si if (link[idx].rx.buf->len > link[idx].rx.buf->size) { BT_ERR("%s, Too large provisioning PDU (%u bytes)", __func__, link[idx].rx.buf->len); - // close_link(i, CLOSE_REASON_FAILED); + close_link(idx, CLOSE_REASON_FAILED); return; }