fix: Add missing htons call when adding configured TCP relay.

This commit is contained in:
iphydf 2023-11-22 23:58:07 +00:00
parent 814090f2b8
commit d1e850c56c
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
3 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ static void test_dht_getnodes(AutoTox *autotoxes)
tox_self_get_dht_id(autotoxes[i].tox, public_key_list[i]);
tox_callback_dht_get_nodes_response(autotoxes[i].tox, getnodes_response_cb);
printf("Peer %zu dht closenode count total/annouce-capable: %d/%d\n",
printf("Peer %zu dht closenode count total/announce-capable: %d/%d\n",
i,
tox_dht_get_num_closelist(autotoxes[i].tox),
tox_dht_get_num_closelist_announce_capable(autotoxes[i].tox)

View File

@ -1 +1 @@
05c389460de83d58533a658d0df625600bc3e6940bbcc738db9dddee249fac59 /usr/local/bin/tox-bootstrapd
1608abb52cd16775216d01d06569e6437d86ed11e9fc8dc6dc9c1c28668ccd8b /usr/local/bin/tox-bootstrapd

View File

@ -2627,7 +2627,7 @@ void do_messenger(Messenger *m, void *userdata)
if (m->tcp_server != nullptr) {
/* Add self tcp server. */
IP_Port local_ip_port;
local_ip_port.port = m->options.tcp_server_port;
local_ip_port.port = net_htons(m->options.tcp_server_port);
local_ip_port.ip.family = net_family_ipv4();
local_ip_port.ip.ip.v4 = get_ip4_loopback();
add_tcp_relay(m->net_crypto, &local_ip_port, tcp_server_public_key(m->tcp_server));