From e529beecd5dda141d28e5468633b162e57b5b09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ma=C5=A1karinec?= Date: Wed, 10 Jan 2024 16:08:50 +0100 Subject: [PATCH] fix(mdns): Fix compile error when MDNS_PREDEF_NETIF_ETH is defined, but ETH_ENABLED is not (#459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Maškarinec --- components/mdns/mdns.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 5e0c3523d5b..d55023b21ef 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -18,7 +18,7 @@ #include "esp_log.h" #include "esp_random.h" -#if CONFIG_ETH_ENABLED && CONFIG_MDNS_PREDEF_NETIF_ETH +#if CONFIG_ETH_ENABLED #include "esp_eth.h" #endif #if CONFIG_MDNS_PREDEF_NETIF_STA || CONFIG_MDNS_PREDEF_NETIF_AP @@ -132,7 +132,7 @@ static inline esp_netif_t *esp_netif_from_preset_if(mdns_predef_if_t predef_if) return esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"); case MDNS_IF_AP: return esp_netif_get_handle_from_ifkey("WIFI_AP_DEF"); -#if CONFIG_ETH_ENABLED +#if CONFIG_ETH_ENABLED && CONFIG_MDNS_NETIF_ETH case MDNS_IF_ETH: return esp_netif_get_handle_from_ifkey("ETH_DEF"); #endif @@ -4189,7 +4189,7 @@ void mdns_preset_if_handle_system_event(void *arg, esp_event_base_t event_base, } } else #endif -#if CONFIG_ETH_ENABLED +#if CONFIG_ETH_ENABLED && CONFIG_MDNS_NETIF_ETH if (event_base == ETH_EVENT) { switch (event_id) { case ETHERNET_EVENT_CONNECTED: @@ -4214,7 +4214,7 @@ void mdns_preset_if_handle_system_event(void *arg, esp_event_base_t event_base, post_mdns_enable_pcb(MDNS_IF_STA, MDNS_IP_PROTOCOL_V4); post_mdns_announce_pcb(MDNS_IF_STA, MDNS_IP_PROTOCOL_V6); break; -#if CONFIG_ETH_ENABLED +#if CONFIG_ETH_ENABLED && CONFIG_MDNS_NETIF_ETH case IP_EVENT_ETH_GOT_IP: post_mdns_enable_pcb(MDNS_IF_ETH, MDNS_IP_PROTOCOL_V4); break;