Skip to content

Commit da18d13

Browse files
wqx6suren-gabrielyan-espressif
authored andcommitted
fix(mdns): define CONFIG_LWIP_IPV4 in mdns_private.h if it is not defined for IDF v5.0
1 parent 0641701 commit da18d13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/mdns/mdns_networking_socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static inline char *get_string_address(struct sockaddr_storage *source_addr)
144144
}
145145
#endif
146146
#ifdef CONFIG_LWIP_IPV6
147-
if (source_addr->ss_family == PF_INET6) {
147+
else if (source_addr->ss_family == PF_INET6) {
148148
res = inet6_ntoa_r(((struct sockaddr_in6 *)source_addr)->sin6_addr, address_str, sizeof(address_str));
149149
}
150150
#endif
@@ -226,7 +226,7 @@ static inline void inet_to_espaddr(const struct sockaddr_storage *in_addr, esp_i
226226
}
227227
#endif /* CONFIG_LWIP_IPV4 */
228228
#ifdef CONFIG_LWIP_IPV6
229-
if (in_addr->ss_family == PF_INET6) {
229+
else if (in_addr->ss_family == PF_INET6) {
230230
struct sockaddr_in6 *in_addr_ip6 = (struct sockaddr_in6 *)in_addr;
231231
memset(addr, 0, sizeof(esp_ip_addr_t));
232232
*port = in_addr_ip6->sin6_port;

0 commit comments

Comments
 (0)