From 2f7e4bd58702afedcae4a9bee96d325f615cd717 Mon Sep 17 00:00:00 2001 From: jani Date: Wed, 19 Mar 2003 16:04:54 +0000 Subject: [PATCH] patch 1197 form floriZ.When debug is on and port is 0 in udp_bind ERR_USE is always returned due to missing braces.Reindent that part of code while at it --- src/core/udp.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/core/udp.c b/src/core/udp.c index aea61330..631305d3 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -474,18 +474,20 @@ udp_bind(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port) #define UDP_LOCAL_PORT_RANGE_START 4096 #define UDP_LOCAL_PORT_RANGE_END 0x7fff #endif - port = UDP_LOCAL_PORT_RANGE_START; - ipcb = udp_pcbs; - while((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) { - if(ipcb->local_port == port) { - port++; - ipcb = udp_pcbs; - } else - ipcb = ipcb->next; - } - if(ipcb) /* no more ports available in local range */ + port = UDP_LOCAL_PORT_RANGE_START; + ipcb = udp_pcbs; + while((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) { + if(ipcb->local_port == port) { + port++; + ipcb = udp_pcbs; + } else + ipcb = ipcb->next; + } + if(ipcb) { + /* no more ports available in local range */ DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n")); - return ERR_USE; + return ERR_USE; + } } pcb->local_port = port; /* We need to place the PCB on the list if not already there. */