diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-03 05:47:30 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-03 05:47:30 +0100 |
| commit | b142979a036ac53c4e59e1906fed01a76198ba84 (patch) | |
| tree | 481ebdafb52552c736b9806b1d337a8d598de521 /src | |
| parent | 0f303ce633ceff5812db44199ca806232ea70914 (diff) | |
Send live sync to the port it listens on
Diffstat (limited to 'src')
| -rw-r--r-- | src/ot_livesync.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ | |||
| 23 | #ifdef WANT_SYNC_LIVE | 23 | #ifdef WANT_SYNC_LIVE |
| 24 | 24 | ||
| 25 | ot_ip6 groupip_1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 224, 0, 23, 5}; | 25 | ot_ip6 groupip_1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 224, 0, 23, 5}; |
| 26 | static uint16_t g_port = LIVESYNC_PORT; | ||
| 26 | 27 | ||
| 27 | #define LIVESYNC_INCOMING_BUFFSIZE (256 * 256) | 28 | #define LIVESYNC_INCOMING_BUFFSIZE (256 * 256) |
| 28 | 29 | ||
| @@ -102,6 +103,8 @@ void livesync_bind_mcast(ot_ip6 ip, uint16_t port) { | |||
| 102 | if (g_socket_in != -1) | 103 | if (g_socket_in != -1) |
| 103 | exerr("Error: Livesync listen ip specified twice."); | 104 | exerr("Error: Livesync listen ip specified twice."); |
| 104 | 105 | ||
| 106 | g_port = port; | ||
| 107 | |||
| 105 | if ((g_socket_in = socket_mcast_join(groupip_1, ip, port)) == -1) | 108 | if ((g_socket_in = socket_mcast_join(groupip_1, ip, port)) == -1) |
| 106 | exerr("Error: Cant bind live sync incoming socket."); | 109 | exerr("Error: Cant bind live sync incoming socket."); |
| 107 | 110 | ||
| @@ -122,7 +125,7 @@ static void livesync_issue_peersync(sync_buffer *buf) { | |||
| 122 | has modified the protected element */ | 125 | has modified the protected element */ |
| 123 | pthread_mutex_unlock(&g_outbuf_mutex); | 126 | pthread_mutex_unlock(&g_outbuf_mutex); |
| 124 | 127 | ||
| 125 | socket_mcast_send(g_socket_out, mycopy, fill, groupip_1, LIVESYNC_PORT); | 128 | socket_mcast_send(g_socket_out, mycopy, fill, groupip_1, g_port); |
| 126 | } | 129 | } |
| 127 | 130 | ||
| 128 | static void livesync_handle_peersync(struct ot_workstruct *ws, size_t peer_size) { | 131 | static void livesync_handle_peersync(struct ot_workstruct *ws, size_t peer_size) { |
