File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
components/esp_http_server/src/util Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
1111#include <netinet/in.h>
1212#include <arpa/inet.h>
1313#include "sdkconfig.h"
14-
14+ #include "esp_log.h"
1515#include "ctrl_sock.h"
1616
1717#if CONFIG_IDF_TARGET_LINUX
2222#define IPV6_ENABLED CONFIG_LWIP_IPV6
2323#endif // !CONFIG_IDF_TARGET_LINUX
2424
25+ #if !CONFIG_LWIP_NETIF_LOOPBACK
26+ static const char * TAG = "esp_http_server" ;
27+ #endif
28+
2529/* Control socket, because in some network stacks select can't be woken up any
2630 * other way
2731 */
2832int cs_create_ctrl_sock (int port )
2933{
34+ #if !CONFIG_LWIP_NETIF_LOOPBACK
35+ ESP_LOGE (TAG , "Please enable LWIP_NETIF_LOOPBACK for %s API" , __func__ );
36+ return -1 ;
37+ #endif
38+
3039 int fd = socket (AF_INET , SOCK_DGRAM , IPPROTO_UDP );
3140 if (fd < 0 ) {
3241 return -1 ;
You can’t perform that action at this time.
0 commit comments