You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/08/11 21:27:19 UTC

[19/50] [abbrv] 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/4b24ccae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/4b24ccae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/4b24ccae

Branch: refs/heads/phyrx_no_mbuf
Commit: 4b24ccae17f92f8deba58f4d2de45b69577d890c
Parents: c7fbdb8
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Aug 5 12:19:15 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Thu Aug 11 14:26:25 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/4b24ccae/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);