You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by "sjanc (via GitHub)" <gi...@apache.org> on 2023/08/01 13:39:34 UTC

[GitHub] [mynewt-nimble] sjanc commented on a diff in pull request #1557: nimble/host : Added leading_space as parameter to os_msys_get_pkthdr

sjanc commented on code in PR #1557:
URL: https://github.com/apache/mynewt-nimble/pull/1557#discussion_r1280663045


##########
nimble/host/src/ble_hs_mbuf.c:
##########
@@ -31,9 +31,9 @@ ble_hs_mbuf_gen_pkt(uint16_t leading_space)
     int rc;
 
 #if MYNEWT_VAL(BLE_CONTROLLER)
-    om = os_msys_get_pkthdr(0, sizeof(struct ble_mbuf_hdr));
+    om = os_msys_get_pkthdr(leading_space, sizeof(struct ble_mbuf_hdr));
 #else
-    om = os_msys_get_pkthdr(0, 0);
+    om = os_msys_get_pkthdr(leading_space, 0);

Review Comment:
   OK, so I've looked at the code and I don't think this is valid change...
   
   here leading_space is only for protocol headers (eg ACL header), while dsize param in os_msys_get_pkthdr() is useful only of one know exact data size that will be used. This is not the case here since there will be actual (variable length)  data after headers (after leading_space).
   
   If we pass leading_space as dsize we could end up with mbuf that is too small as it may have space only for header (which is leading_space)
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org