diff --git a/components/mdns/mdns_networking_socket.c b/components/mdns/mdns_networking_socket.c index 8411e26e6d..a99a9cc2d9 100644 --- a/components/mdns/mdns_networking_socket.c +++ b/components/mdns/mdns_networking_socket.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -352,17 +352,9 @@ static bool create_pcb(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol) } int sock = s_interfaces[tcpip_if].sock; esp_netif_t *netif = _mdns_get_esp_netif(tcpip_if); - if (sock >= 0) { - mdns_ip_protocol_t other_ip_proto = ip_protocol == MDNS_IP_PROTOCOL_V4 ? MDNS_IP_PROTOCOL_V6 : MDNS_IP_PROTOCOL_V4; - int err = join_mdns_multicast_group(sock, netif, other_ip_proto); - if (err < 0) { - ESP_LOGE(TAG, "Failed to add ipv6 multicast group for protocol %d", ip_protocol); - return false; - } - s_interfaces[tcpip_if].proto |= (other_ip_proto == MDNS_IP_PROTOCOL_V4 ? PROTO_IPV4 : PROTO_IPV6); - return true; + if (sock < 0) { + sock = create_socket(netif); } - sock = create_socket(netif); if (sock < 0) { ESP_LOGE(TAG, "Failed to create the socket!"); return false;