net: Check error when pushing packet into stack

Make tcpip_input() to return 0 if there is an error when
processing the packet. Value != 0 indicates a successfull
packet processing and in this case the application will
free the packet.

Change-Id: I4aaeb5f0039cfbe25f7238a144964e31a8204148
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2015-05-28 10:30:08 +03:00 committed by Anas Nashif
commit 6fe17bb7a5
4 changed files with 17 additions and 9 deletions

View file

@ -2325,11 +2325,6 @@ uip_process(struct net_buf *buf, uint8_t flag)
return 1;
drop:
/* If there is an error, then just return the buffer to pool */
if (uip_len(buf) == 0) {
net_buf_put(buf);
}
uip_len(buf) = 0;
uip_ext_len(buf) = 0;
uip_ext_bitmap(buf) = 0;