mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_netif: initialize TCP ISN hook if enabled in configuration
This commit is contained in:
parent
4dd7cfbeb7
commit
8265966974
@ -35,6 +35,10 @@
|
||||
#include "netif/ethernetif.h"
|
||||
#include "netif/nettestif.h"
|
||||
|
||||
#if CONFIG_LWIP_TCP_ISN_HOOK
|
||||
#include "tcp_isn.h"
|
||||
#endif
|
||||
|
||||
#include "dhcpserver/dhcpserver.h"
|
||||
#include "dhcpserver/dhcpserver_options.h"
|
||||
|
||||
@ -106,6 +110,18 @@ void tcpip_adapter_init(void)
|
||||
int ret;
|
||||
|
||||
if (tcpip_inited == false) {
|
||||
#if CONFIG_LWIP_TCP_ISN_HOOK
|
||||
uint8_t rand_buf[16];
|
||||
/*
|
||||
* This is early startup code where WiFi/BT is yet to be enabled and hence
|
||||
* relevant entropy source is not available. However, bootloader enables
|
||||
* SAR ADC based entropy source at its initialization, and our requirement
|
||||
* of random bytes is pretty small (16), so we can assume that following
|
||||
* API will provide sufficiently random data.
|
||||
*/
|
||||
esp_fill_random(rand_buf, sizeof(rand_buf));
|
||||
lwip_init_tcp_isn(esp_log_timestamp(), rand_buf);
|
||||
#endif
|
||||
tcpip_inited = true;
|
||||
|
||||
tcpip_init(NULL, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user