summaryrefslogtreecommitdiff
path: root/ot_livesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_livesync.c')
-rw-r--r--ot_livesync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ot_livesync.c b/ot_livesync.c
index c4dc6e5..f6bb28b 100644
--- a/ot_livesync.c
+++ b/ot_livesync.c
@@ -13,11 +13,11 @@
13#include <unistd.h> 13#include <unistd.h>
14 14
15/* Libowfat */ 15/* Libowfat */
16#include "ip6.h"
17#include "socket.h" 16#include "socket.h"
18 17
19/* Opentracker */ 18/* Opentracker */
20#include "ot_accesslist.h" 19#include "ot_accesslist.h"
20#include "ot_ip.h"
21#include "ot_livesync.h" 21#include "ot_livesync.h"
22#include "ot_mutex.h" 22#include "ot_mutex.h"
23#include "ot_stats.h" 23#include "ot_stats.h"
@@ -92,7 +92,7 @@ void livesync_bind_mcast(ot_ip6 ip, uint16_t port) {
92 char tmpip[4] = {0, 0, 0, 0}; 92 char tmpip[4] = {0, 0, 0, 0};
93 char *v4ip; 93 char *v4ip;
94 94
95 if (!ip6_isv4mapped(ip)) 95 if (!ip_is_v4mapped(ip))
96 exerr("v6 mcast support not yet available."); 96 exerr("v6 mcast support not yet available.");
97 v4ip = ip + 12; 97 v4ip = ip + 12;
98 98
@@ -140,14 +140,14 @@ static void livesync_handle_peersync(struct ot_workstruct *ws, size_t peer_size)
140 140
141 /* Prepare peer record for v4mapped expansion */ 141 /* Prepare peer record for v4mapped expansion */
142 if (peer_size == OT_PEER_SIZE4) 142 if (peer_size == OT_PEER_SIZE4)
143 memcpy(&ws->peer, V4mappedprefix, sizeof(V4mappedprefix)); 143 memcpy(&ws->peer, ip_v4mapped_prefix, sizeof(ip_v4mapped_prefix));
144 144
145 /* Now basic sanity checks have been done on the live sync packet 145 /* Now basic sanity checks have been done on the live sync packet
146 We might add more testing and logging. */ 146 We might add more testing and logging. */
147 while ((ssize_t)(off + sizeof(ot_hash) + peer_size) <= ws->request_size) { 147 while ((ssize_t)(off + sizeof(ot_hash) + peer_size) <= ws->request_size) {
148 char *peer_ip = ws->request + off + sizeof(ot_hash); 148 char *peer_ip = ws->request + off + sizeof(ot_hash);
149 if (peer_size == OT_PEER_SIZE4) 149 if (peer_size == OT_PEER_SIZE4)
150 memcpy(&ws->peer[0] + sizeof(V4mappedprefix), peer_ip, peer_size); 150 memcpy(&ws->peer[0] + sizeof(ip_v4mapped_prefix), peer_ip, peer_size);
151 else 151 else
152 memcpy(&ws->peer, peer_ip, peer_size); 152 memcpy(&ws->peer, peer_ip, peer_size);
153 ws->hash = (ot_hash *)(ws->request + off); 153 ws->hash = (ot_hash *)(ws->request + off);
@@ -215,7 +215,7 @@ static void *livesync_worker(void *args) {
215 ws.inbuf = ws.request = malloc(LIVESYNC_INCOMING_BUFFSIZE); 215 ws.inbuf = ws.request = malloc(LIVESYNC_INCOMING_BUFFSIZE);
216 ws.outbuf = ws.reply = 0; 216 ws.outbuf = ws.reply = 0;
217 217
218 memcpy(in_ip, V4mappedprefix, sizeof(V4mappedprefix)); 218 memcpy(in_ip, ip_v4mapped_prefix, sizeof(ip_v4mapped_prefix));
219 219
220 while (1) { 220 while (1) {
221 uint32_t packet_type; 221 uint32_t packet_type;