net: initialize ip_buf_len when receiving packet

When udp_packet_receive is called, ip_buf_len is set 4 bytes too big.
This ends up with the client program receiving 4 bytes more than the
board actually received. Initialize it correctly alongside other values.

Change-Id: I0012aa7e8c6a440a618dfa03c4fdc2b898d592fc
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
This commit is contained in:
Jaakko Hannikainen 2016-06-27 11:30:04 +03:00 committed by Jukka Rissanen
commit 0616c2679b

View file

@ -575,6 +575,7 @@ static void udp_packet_receive(struct simple_udp_connection *c,
ip_buf_appdatalen(buf) = datalen;
ip_buf_appdata(buf) = &uip_buf(buf)[UIP_IPUDPH_LEN + UIP_LLH_LEN];
ip_buf_len(buf) = datalen + UIP_IPUDPH_LEN + UIP_LLH_LEN;
NET_DBG("packet received context %p len %d "
"appdata %p appdatalen %d\n",