nimble/att: Fix no responding with error for invalid data We should always responde to avoid stalling ATT channel.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/f6800fc7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f6800fc7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f6800fc7 Branch: refs/heads/master Commit: f6800fc7e083c392fb50c05637714dfe7cff29a2 Parents: 1e81657 Author: Szymon Janc <szymon.j...@codecoup.pl> Authored: Fri Mar 24 15:50:02 2017 +0100 Committer: Szymon Janc <szymon.j...@codecoup.pl> Committed: Mon Apr 10 11:31:32 2017 +0200 ---------------------------------------------------------------------- net/nimble/host/src/ble_att_svr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f6800fc7/net/nimble/host/src/ble_att_svr.c ---------------------------------------------------------------------- diff --git a/net/nimble/host/src/ble_att_svr.c b/net/nimble/host/src/ble_att_svr.c index 022a0fb..8a6acc3 100644 --- a/net/nimble/host/src/ble_att_svr.c +++ b/net/nimble/host/src/ble_att_svr.c @@ -1431,7 +1431,8 @@ ble_att_svr_rx_read_type(uint16_t conn_handle, struct os_mbuf **rxom) pktlen != BLE_ATT_READ_TYPE_REQ_SZ_128) { /* Malformed packet; discard. */ - return BLE_HS_EBADDATA; + rc = BLE_HS_EBADDATA; + goto done; } rc = ble_att_svr_pullup_req_base(rxom, pktlen, &att_err);