mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-29 03:14:04 +00:00
Added debug messages for serious errors.
This commit is contained in:
parent
37ff512516
commit
917f8ec799
@ -56,11 +56,13 @@
|
|||||||
#include "arch/perf.h"
|
#include "arch/perf.h"
|
||||||
#include "lwip/snmp.h"
|
#include "lwip/snmp.h"
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
//#undef DEBUGF
|
||||||
|
//#define DEBUGF(x,y) { page_printf("\f"); page_printf y; };
|
||||||
|
|
||||||
/* The list of UDP PCBs. */
|
/* The list of UDP PCBs */
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
/*static*/ struct udp_pcb *udp_pcbs = NULL;
|
/* was static, but we may want to access this from a socket layer */
|
||||||
|
struct udp_pcb *udp_pcbs = NULL;
|
||||||
|
|
||||||
static struct udp_pcb *pcb_cache = NULL;
|
static struct udp_pcb *pcb_cache = NULL;
|
||||||
|
|
||||||
@ -336,10 +338,13 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
|||||||
|
|
||||||
/* if the PCB is not yet bound, bind it here */
|
/* if the PCB is not yet bound, bind it here */
|
||||||
if (pcb->local_port == 0) {
|
if (pcb->local_port == 0) {
|
||||||
|
DEBUGF(UDP_DEBUG | DBG_TRACE | 2, ("udp_send: not yet bound\n"));
|
||||||
err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
|
err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
|
||||||
if(err != ERR_OK)
|
if (err != ERR_OK) {
|
||||||
|
DEBUGF(UDP_DEBUG | DBG_TRACE | 2, ("udp_send: forced bind failed\n"));
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* not enough space to add an UDP header to first pbuf in given p chain? */
|
/* not enough space to add an UDP header to first pbuf in given p chain? */
|
||||||
if (pbuf_header(p, UDP_HLEN)) {
|
if (pbuf_header(p, UDP_HLEN)) {
|
||||||
@ -347,6 +352,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
|||||||
q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
|
q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
|
||||||
/* new header pbuf could not be allocated? */
|
/* new header pbuf could not be allocated? */
|
||||||
if (q == NULL) {
|
if (q == NULL) {
|
||||||
|
DEBUGF(UDP_DEBUG | DBG_TRACE | 2, ("udp_send: could not allocate header\n"));
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
/* chain header q in front of given pbuf p */
|
/* chain header q in front of given pbuf p */
|
||||||
|
Loading…
Reference in New Issue
Block a user