net: udp: Do not mark the packet to be dropped if received ok
If the udp packet was successfully delivered to the application, and if the application did not want to send anything back to sender, then then uip_slen(buf) will be 0. In this case we MUST NOT set uip_len(buf) to 0 as that would cause the net_buf to be released by RX fiber. In this case it is application responsibility to release the buffer. Change-Id: I43cf9b147a45294288dc3c631908b034e1a4ab6a Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
3be36754db
commit
63512ac2f3
1 changed files with 8 additions and 0 deletions
|
@ -1558,6 +1558,14 @@ uip_process(struct net_buf *buf, uint8_t flag)
|
||||||
uip_sappdata(buf) = uip_appdata(buf) = &uip_buf(buf)[UIP_IPUDPH_LEN + UIP_LLH_LEN];
|
uip_sappdata(buf) = uip_appdata(buf) = &uip_buf(buf)[UIP_IPUDPH_LEN + UIP_LLH_LEN];
|
||||||
uip_slen(buf) = 0;
|
uip_slen(buf) = 0;
|
||||||
UIP_UDP_APPCALL(buf);
|
UIP_UDP_APPCALL(buf);
|
||||||
|
if(uip_slen(buf) == 0) {
|
||||||
|
/* If the application does not want to send anything, then uip_slen(buf)
|
||||||
|
* will be 0. In this case we MUST NOT set uip_len(buf) to 0 as that would
|
||||||
|
* cause the net_buf to be released by rx fiber. In this case it is
|
||||||
|
* application responsibility to release the buffer.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
udp_send:
|
udp_send:
|
||||||
PRINTF("In udp_send\n");
|
PRINTF("In udp_send\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue