diff --git a/src/platforms/hosted/gdb_if.c b/src/platforms/hosted/gdb_if.c index 9a4d7d5e0ce..09bf16a4b1b 100644 --- a/src/platforms/hosted/gdb_if.c +++ b/src/platforms/hosted/gdb_if.c @@ -252,6 +252,12 @@ int gdb_if_init(void) !socket_set_int_opt(gdb_if_serv, IPPROTO_TCP, TCP_NODELAY, 1)) continue; + if (addr.ss_family == AF_INET6) { + DEBUG_INFO("Setting V6ONLY to off for dual stack listening.\n"); + if (!socket_set_int_opt(gdb_if_serv, IPPROTO_IPV6, IPV6_V6ONLY, 0)) + DEBUG_WARN("Listening on IPv6 only.\n"); + } + if (bind(gdb_if_serv, (sockaddr_s *)&addr, family_to_size(addr.ss_family)) == -1) { handle_error(gdb_if_serv, "binding socket"); continue;