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:
Jukka Rissanen 2015-07-31 16:24:28 +03:00 committed by Anas Nashif
commit e6d1925a96
7 changed files with 23 additions and 12 deletions

View file

@ -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.