net: Fix incorrect IP app data length

When application wants to send zero length data, packet is dropped.
And uip_appdatalen is wrongly assigned with total IP packet length.

Jira: ZEP-575

Change-Id: I7f714cbef74dc28b83db7a776ef80a3026ae120e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2016-07-25 15:35:54 +03:00 committed by Andrew Boie
commit b325989ede
2 changed files with 1 additions and 4 deletions

View file

@ -1712,9 +1712,6 @@ uip_process(struct net_buf **buf_out, uint8_t flag)
udp_send:
PRINTF("In udp_send\n");
if(uip_slen(buf) == 0) {
goto drop;
}
uip_len(buf) = uip_slen(buf) + UIP_IPUDPH_LEN;
/* For IPv6, the IP length field does not include the IPv6 IP header

View file

@ -124,7 +124,7 @@ int net_send(struct net_buf *buf)
}
if (buf->len && !uip_appdatalen(buf)) {
uip_appdatalen(buf) = buf->len;
uip_appdatalen(buf) = ip_buf_appdatalen(buf);
}
switch (sys_execution_context_type_get()) {