net: Make sure Contiki will not remove received packet
We must not touch uip_len(buf) value as Contiki IP stack will use it to determine what it should do with the received packet. So after we have received the packet, we update separate datalen variable in net_buf that will store the correct length of the packet. Change-Id: Iab79b741508e95e581d1727645e6b1d1eacded4c Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
d3b0d1afdf
commit
e6d1925a96
7 changed files with 23 additions and 12 deletions
|
@ -124,8 +124,8 @@ int net_set_mac(uint8_t *mac, uint8_t len);
|
|||
*
|
||||
* @details Application can call this function if it has received
|
||||
* a network packet from peer. The application needs to write
|
||||
* reply data into net_buf. The app can use uip_appdata(buf) and
|
||||
* uip_appdatalen(buf) to set the application data and length.
|
||||
* reply data into net_buf. The app can use net_buf_data(buf) and
|
||||
* net_buf_datalen(buf) to set the application data and length.
|
||||
*
|
||||
* @param context Network context
|
||||
* @param buf Network buffer containing the network data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue