This is the mail archive of the ecos-devel@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC 9/9] * Ensure udp stats counter correct when dropped packets


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 <andrewp@carallon.com>
Signed-off-by: Will Wagner <willw@carallon.com>
---
 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]