[PATCH rtems-lwip 2/3] lwip/api: Notify about dropped packets
Kinsey Moore
kinsey.moore at oarcorp.com
Thu Mar 2 22:59:43 UTC 2023
The receive UDP and raw mailboxes will silently drop packets once the
mailbox is full. This provides a debug message if debugging is enabled
when this is the case to direct the user toward a solution.
---
lwip/src/api/api_msg.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lwip/src/api/api_msg.c b/lwip/src/api/api_msg.c
index 3f08e03..e3eab42 100644
--- a/lwip/src/api/api_msg.c
+++ b/lwip/src/api/api_msg.c
@@ -191,6 +191,10 @@ recv_raw(void *arg, struct raw_pcb *pcb, struct pbuf *p,
len = q->tot_len;
if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) {
+#ifdef __rtems__
+ LWIP_DEBUGF(API_MSG_DEBUG | LWIP_DBG_LEVEL_WARNING,
+ ("recv_raw: dropping packet\n"));
+#endif
netbuf_delete(buf);
return 0;
} else {
@@ -270,6 +274,10 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
len = p->tot_len;
if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) {
+#ifdef __rtems__
+ LWIP_DEBUGF(API_MSG_DEBUG | LWIP_DBG_LEVEL_WARNING,
+ ("recv_udp: dropping packet\n"));
+#endif
netbuf_delete(buf);
return;
} else {
--
2.30.2
More information about the devel
mailing list