summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ot_livesync.c5
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
25ot_ip6 groupip_1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 224, 0, 23, 5}; 25ot_ip6 groupip_1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 224, 0, 23, 5};
26static 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
128static void livesync_handle_peersync(struct ot_workstruct *ws, size_t peer_size) { 131static void livesync_handle_peersync(struct ot_workstruct *ws, size_t peer_size) {