From 540b527cf4c1c18cd1729f1bde4f40738573f794 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 24 Mar 2017 14:29:06 +0100 Subject: [PATCH] remove LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS config option (this is implicitly done via #ifdef LWIP_RAND) --- src/core/tcp.c | 4 ++-- src/core/udp.c | 4 ++-- src/include/lwip/opt.h | 9 --------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index c8e23186..e2d10ba1 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -144,9 +144,9 @@ static err_t tcp_close_shutdown_fin(struct tcp_pcb *pcb); void tcp_init(void) { -#if LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) +#ifdef LWIP_RAND tcp_port = TCP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND()); -#endif /* LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) */ +#endif /* LWIP_RAND */ } /** diff --git a/src/core/udp.c b/src/core/udp.c index ec4b25f6..68c1d785 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -86,9 +86,9 @@ struct udp_pcb *udp_pcbs; void udp_init(void) { -#if LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) +#ifdef LWIP_RAND udp_port = UDP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND()); -#endif /* LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) */ +#endif /* LWIP_RAND */ } /** diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 83155a0c..c691a42a 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -748,15 +748,6 @@ #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 #endif - -/** - * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first - * local TCP/UDP pcb (default==0). This can prevent creating predictable port - * numbers after booting a device. - */ -#if !defined LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS || defined __DOXYGEN__ -#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0 -#endif /** * @} */