From b142979a036ac53c4e59e1906fed01a76198ba84 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 3 Nov 2026 05:47:30 +0100 Subject: Send live sync to the port it listens on --- src/ot_livesync.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ot_livesync.c') diff --git a/src/ot_livesync.c b/src/ot_livesync.c index 9770bbc..11b75d2 100644 --- a/src/ot_livesync.c +++ b/src/ot_livesync.c @@ -23,6 +23,7 @@ #ifdef WANT_SYNC_LIVE ot_ip6 groupip_1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 224, 0, 23, 5}; +static uint16_t g_port = LIVESYNC_PORT; #define LIVESYNC_INCOMING_BUFFSIZE (256 * 256) @@ -102,6 +103,8 @@ void livesync_bind_mcast(ot_ip6 ip, uint16_t port) { if (g_socket_in != -1) exerr("Error: Livesync listen ip specified twice."); + g_port = port; + if ((g_socket_in = socket_mcast_join(groupip_1, ip, port)) == -1) exerr("Error: Cant bind live sync incoming socket."); @@ -122,7 +125,7 @@ static void livesync_issue_peersync(sync_buffer *buf) { has modified the protected element */ pthread_mutex_unlock(&g_outbuf_mutex); - socket_mcast_send(g_socket_out, mycopy, fill, groupip_1, LIVESYNC_PORT); + socket_mcast_send(g_socket_out, mycopy, fill, groupip_1, g_port); } static void livesync_handle_peersync(struct ot_workstruct *ws, size_t peer_size) { -- cgit v1.3