/[lwip]/lwip/src/core/udp.c
ViewVC logotype

Diff of /lwip/src/core/udp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by likewise, Sun Mar 16 22:39:15 2003 UTC revision 1.24 by jani, Wed Mar 19 16:04:54 2003 UTC
# Line 474  udp_bind(struct udp_pcb *pcb, struct ip_ Line 474  udp_bind(struct udp_pcb *pcb, struct ip_
474  #define UDP_LOCAL_PORT_RANGE_START 4096  #define UDP_LOCAL_PORT_RANGE_START 4096
475  #define UDP_LOCAL_PORT_RANGE_END   0x7fff  #define UDP_LOCAL_PORT_RANGE_END   0x7fff
476  #endif  #endif
477          port = UDP_LOCAL_PORT_RANGE_START;      port = UDP_LOCAL_PORT_RANGE_START;
478          ipcb = udp_pcbs;      ipcb = udp_pcbs;
479          while((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) {      while((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) {
480                  if(ipcb->local_port == port) {        if(ipcb->local_port == port) {
481                          port++;          port++;
482                          ipcb = udp_pcbs;          ipcb = udp_pcbs;
483                  } else        } else
484                          ipcb = ipcb->next;          ipcb = ipcb->next;
485          }      }
486          if(ipcb) /* no more ports available in local range */      if(ipcb)  {
487          /* no more ports available in local range */
488        DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));        DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));
489                  return ERR_USE;        return ERR_USE;
490        }  
491    }    }
492    pcb->local_port = port;    pcb->local_port = port;
493    /* We need to place the PCB on the list if not already there. */    /* We need to place the PCB on the list if not already there. */

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26