You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/08/09 23:07:38 UTC
[04/42] incubator-mynewt-core git commit: BLE Host - Don't assume
leading space in l2cap tx.
BLE Host - Don't assume leading space in l2cap tx.
Call os_mbuf_prepend_pullup() rather than calling os_mbuf_prepend() and
assuming the resulting buffer is the same as the input.
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/1efa31fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1efa31fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1efa31fc
Branch: refs/heads/sterly_refactor
Commit: 1efa31fc2ef422d804c926271516c8735b833f05
Parents: 009bb6c
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Aug 5 12:19:15 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Tue Aug 9 16:05:21 2016 -0700
----------------------------------------------------------------------
net/nimble/host/src/ble_l2cap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1efa31fc/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index 66bad51..43ccd6f 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -119,16 +119,14 @@ struct os_mbuf *
ble_l2cap_prepend_hdr(struct os_mbuf *om, uint16_t cid, uint16_t len)
{
struct ble_l2cap_hdr hdr;
- struct os_mbuf *om2;
htole16(&hdr.blh_len, len);
htole16(&hdr.blh_cid, cid);
- om2 = os_mbuf_prepend(om, sizeof hdr);
- if (om2 == NULL) {
+ om = os_mbuf_prepend_pullup(om, sizeof hdr);
+ if (om == NULL) {
return NULL;
}
- BLE_HS_DBG_ASSERT(om2 == om);
memcpy(om->om_data, &hdr, sizeof hdr);