[RFC 9/9] * Ensure udp stats counter correct when dropped packets
Will Wagner <[email protected]> Thu, 27 Jun 2013 20:22:53 +0100
| Newsgroups | gmane.os.ecos.devel |
|---|---|
| Message-ID | <[email protected]> |
There is a code path when udp packets are dropped due to lack of buffers where the stats object is not correctly updated. Signed-off-by: Andrew Parlane <[email protected]> Signed-off-by: Will Wagner <[email protected]> --- packages/net/lwip_tcpip/current/src/api/api_msg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/net/lwip_tcpip/current/src/api/api_msg.c b/packages/net/lwip_tcpip/current/src/api/api_msg.c index d4e44b9..25fa01b 100644 --- a/packages/net/lwip_tcpip/current/src/api/api_msg.c +++ b/packages/net/lwip_tcpip/current/src/api/api_msg.c @@ -51,6 +51,7 @@ #include "lwip/tcpip.h" #include "lwip/igmp.h" #include "lwip/dns.h" +#include "lwip/stats.h" #include <string.h> @@ -193,6 +194,7 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p, len = p->tot_len; if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) { + UDP_STATS_INC(udp.drop); netbuf_delete(buf); return; } else { -- 1.8.1.msysgit.1