Displaying 1 result from an estimated 1 matches for "udp_local_port_range_end".
2016 Jul 04
2
[PATCH] core/lwip: Avoid immediate reuse of UDP port numbers
...er
+ */
+static u16_t
+udp_new_port(void)
+{
+ struct udp_pcb *pcb;
+#ifndef UDP_LOCAL_PORT_RANGE_START
+/* From http://www.iana.org/assignments/port-numbers:
+ "The Dynamic and/or Private Ports are those from 49152 through 65535" */
+#define UDP_LOCAL_PORT_RANGE_START 0xc000
+#define UDP_LOCAL_PORT_RANGE_END 0xffff
+#endif
+ static u16_t port = UDP_LOCAL_PORT_RANGE_START;
+
+ again:
+ if (port++ >= UDP_LOCAL_PORT_RANGE_END) {
+ port = UDP_LOCAL_PORT_RANGE_START;
+ }
+ /* Check PCB list. */
+ for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
+ if (pcb->local_port == port) {
+...