fix: dont resolve to ipv6 addresses when its disabled

This commit is contained in:
Green Sky 2024-01-15 13:11:35 +01:00
parent d3b935f63f
commit 001d00ab30
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View File

@ -1 +1 @@
5061f92a95ba45cfa49d78175fa8fb6e4d66a58d86634ea3fd3ae6d80cb0558a /usr/local/bin/tox-bootstrapd ccaf7a29c16d97068952d872b8663e38cc3d958aff01baeafee04e0ac6f3ac98 /usr/local/bin/tox-bootstrapd

View File

@ -1058,6 +1058,11 @@ bool tox_bootstrap(Tox *tox, const char *host, uint16_t port, const uint8_t publ
bool udp_success = tox->m->options.udp_disabled; bool udp_success = tox->m->options.udp_disabled;
for (int32_t i = 0; i < count; ++i) { for (int32_t i = 0; i < count; ++i) {
if (!tox->m->options.ipv6enabled && net_family_is_ipv6(root[i].ip.family)) {
// We can't use ipv6 when it's disabled.
continue;
}
root[i].port = net_htons(port); root[i].port = net_htons(port);
if (onion_add_bs_path_node(tox->m->onion_c, &root[i], public_key)) { if (onion_add_bs_path_node(tox->m->onion_c, &root[i], public_key)) {