public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* [RFC 9/9] * Ensure udp stats counter correct when dropped packets
@ 2013-06-27 19:22 Will Wagner
  0 siblings, 0 replies; only message in thread
From: Will Wagner @ 2013-06-27 19:22 UTC (permalink / raw)
  To: eCos development list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-27 19:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-27 19:22 [RFC 9/9] * Ensure udp stats counter correct when dropped packets Will Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).