From 7b4a20f64eba19ce98f5dfa9b325c5bf87890bd1 Mon Sep 17 00:00:00 2001 From: Mario Kicherer Date: Thu, 10 Oct 2024 15:03:27 +0200 Subject: [PATCH] coap_join_mcast_group_intf: fix interface selection on windows --- src/coap_net.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/coap_net.c b/src/coap_net.c index 24b3c7fa33..9c323e2819 100644 --- a/src/coap_net.c +++ b/src/coap_net.c @@ -4706,7 +4706,14 @@ coap_join_mcast_group_intf_lkd(coap_context_t *ctx, const char *group_name, } } } -#endif /* ! _WIN32 */ +#else /* _WIN32 */ + /* + * On Windows this function ignores the ifname variable so we unset this + * variable on this platform in any case in order to enable the interface + * selection from the bind address below. + */ + ifname = 0; +#endif /* _WIN32 */ /* Add in mcast address(es) to appropriate interface */ for (ainfo = resmulti; ainfo != NULL; ainfo = ainfo->ai_next) {