diff options
Diffstat (limited to 'src/nat/gnunet-helper-nat-client-windows.c')
-rw-r--r-- | src/nat/gnunet-helper-nat-client-windows.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nat/gnunet-helper-nat-client-windows.c b/src/nat/gnunet-helper-nat-client-windows.c index fd2fbd716..89dad9e7b 100644 --- a/src/nat/gnunet-helper-nat-client-windows.c +++ b/src/nat/gnunet-helper-nat-client-windows.c | |||
@@ -265,14 +265,14 @@ send_icmp_udp (const struct in_addr *my_ip, const struct in_addr *other) | |||
265 | ip_pkt.dst_ip = other->s_addr; | 265 | ip_pkt.dst_ip = other->s_addr; |
266 | ip_pkt.checksum = | 266 | ip_pkt.checksum = |
267 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); | 267 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); |
268 | memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); | 268 | GNUNET_memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); |
269 | off += sizeof (struct ip_header); | 269 | off += sizeof (struct ip_header); |
270 | 270 | ||
271 | icmp_pkt.type = ICMP_TIME_EXCEEDED; | 271 | icmp_pkt.type = ICMP_TIME_EXCEEDED; |
272 | icmp_pkt.code = 0; | 272 | icmp_pkt.code = 0; |
273 | icmp_pkt.checksum = 0; | 273 | icmp_pkt.checksum = 0; |
274 | icmp_pkt.unused = 0; | 274 | icmp_pkt.unused = 0; |
275 | memcpy (&packet[off], &icmp_pkt, sizeof (struct icmp_ttl_exceeded_header)); | 275 | GNUNET_memcpy (&packet[off], &icmp_pkt, sizeof (struct icmp_ttl_exceeded_header)); |
276 | off += sizeof (struct icmp_ttl_exceeded_header); | 276 | off += sizeof (struct icmp_ttl_exceeded_header); |
277 | 277 | ||
278 | /* ip header of the presumably 'lost' udp packet */ | 278 | /* ip header of the presumably 'lost' udp packet */ |
@@ -289,7 +289,7 @@ send_icmp_udp (const struct in_addr *my_ip, const struct in_addr *other) | |||
289 | ip_pkt.dst_ip = dummy.s_addr; | 289 | ip_pkt.dst_ip = dummy.s_addr; |
290 | ip_pkt.checksum = | 290 | ip_pkt.checksum = |
291 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); | 291 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); |
292 | memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); | 292 | GNUNET_memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); |
293 | off += sizeof (struct ip_header); | 293 | off += sizeof (struct ip_header); |
294 | 294 | ||
295 | /* build UDP header */ | 295 | /* build UDP header */ |
@@ -297,7 +297,7 @@ send_icmp_udp (const struct in_addr *my_ip, const struct in_addr *other) | |||
297 | udp_pkt.dst_port = htons (NAT_TRAV_PORT); | 297 | udp_pkt.dst_port = htons (NAT_TRAV_PORT); |
298 | udp_pkt.length = htons (port); | 298 | udp_pkt.length = htons (port); |
299 | udp_pkt.crc = 0; | 299 | udp_pkt.crc = 0; |
300 | memcpy (&packet[off], &udp_pkt, sizeof (struct udp_header)); | 300 | GNUNET_memcpy (&packet[off], &udp_pkt, sizeof (struct udp_header)); |
301 | off += sizeof (struct udp_header); | 301 | off += sizeof (struct udp_header); |
302 | 302 | ||
303 | /* no go back to calculate ICMP packet checksum */ | 303 | /* no go back to calculate ICMP packet checksum */ |
@@ -306,7 +306,7 @@ send_icmp_udp (const struct in_addr *my_ip, const struct in_addr *other) | |||
306 | ((uint16_t *) & packet[off], | 306 | ((uint16_t *) & packet[off], |
307 | sizeof (struct icmp_ttl_exceeded_header) + | 307 | sizeof (struct icmp_ttl_exceeded_header) + |
308 | sizeof (struct ip_header) + sizeof (struct udp_header))); | 308 | sizeof (struct ip_header) + sizeof (struct udp_header))); |
309 | memcpy (&packet[sizeof (struct ip_header)], &icmp_pkt, | 309 | GNUNET_memcpy (&packet[sizeof (struct ip_header)], &icmp_pkt, |
310 | sizeof (struct icmp_ttl_exceeded_header)); | 310 | sizeof (struct icmp_ttl_exceeded_header)); |
311 | 311 | ||
312 | memset (&dst, 0, sizeof (dst)); | 312 | memset (&dst, 0, sizeof (dst)); |
@@ -359,7 +359,7 @@ send_icmp (const struct in_addr *my_ip, const struct in_addr *other) | |||
359 | ip_pkt.dst_ip = other->s_addr; | 359 | ip_pkt.dst_ip = other->s_addr; |
360 | ip_pkt.checksum = | 360 | ip_pkt.checksum = |
361 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); | 361 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); |
362 | memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); | 362 | GNUNET_memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); |
363 | off += sizeof (ip_pkt); | 363 | off += sizeof (ip_pkt); |
364 | 364 | ||
365 | /* icmp reply: time exceeded */ | 365 | /* icmp reply: time exceeded */ |
@@ -367,7 +367,7 @@ send_icmp (const struct in_addr *my_ip, const struct in_addr *other) | |||
367 | icmp_ttl.code = 0; | 367 | icmp_ttl.code = 0; |
368 | icmp_ttl.checksum = 0; | 368 | icmp_ttl.checksum = 0; |
369 | icmp_ttl.unused = 0; | 369 | icmp_ttl.unused = 0; |
370 | memcpy (&packet[off], &icmp_ttl, sizeof (struct icmp_ttl_exceeded_header)); | 370 | GNUNET_memcpy (&packet[off], &icmp_ttl, sizeof (struct icmp_ttl_exceeded_header)); |
371 | off += sizeof (struct icmp_ttl_exceeded_header); | 371 | off += sizeof (struct icmp_ttl_exceeded_header); |
372 | 372 | ||
373 | /* ip header of the presumably 'lost' udp packet */ | 373 | /* ip header of the presumably 'lost' udp packet */ |
@@ -384,7 +384,7 @@ send_icmp (const struct in_addr *my_ip, const struct in_addr *other) | |||
384 | ip_pkt.checksum = 0; | 384 | ip_pkt.checksum = 0; |
385 | ip_pkt.checksum = | 385 | ip_pkt.checksum = |
386 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); | 386 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); |
387 | memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); | 387 | GNUNET_memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); |
388 | off += sizeof (struct ip_header); | 388 | off += sizeof (struct ip_header); |
389 | 389 | ||
390 | icmp_echo.type = ICMP_ECHO; | 390 | icmp_echo.type = ICMP_ECHO; |
@@ -394,7 +394,7 @@ send_icmp (const struct in_addr *my_ip, const struct in_addr *other) | |||
394 | icmp_echo.checksum = | 394 | icmp_echo.checksum = |
395 | htons (calc_checksum | 395 | htons (calc_checksum |
396 | ((uint16_t *) & icmp_echo, sizeof (struct icmp_echo_header))); | 396 | ((uint16_t *) & icmp_echo, sizeof (struct icmp_echo_header))); |
397 | memcpy (&packet[off], &icmp_echo, sizeof (struct icmp_echo_header)); | 397 | GNUNET_memcpy (&packet[off], &icmp_echo, sizeof (struct icmp_echo_header)); |
398 | 398 | ||
399 | /* no go back to calculate ICMP packet checksum */ | 399 | /* no go back to calculate ICMP packet checksum */ |
400 | off = sizeof (struct ip_header); | 400 | off = sizeof (struct ip_header); |
@@ -403,7 +403,7 @@ send_icmp (const struct in_addr *my_ip, const struct in_addr *other) | |||
403 | ((uint16_t *) & packet[off], | 403 | ((uint16_t *) & packet[off], |
404 | sizeof (struct icmp_ttl_exceeded_header) + | 404 | sizeof (struct icmp_ttl_exceeded_header) + |
405 | sizeof (struct ip_header) + sizeof (struct icmp_echo_header))); | 405 | sizeof (struct ip_header) + sizeof (struct icmp_echo_header))); |
406 | memcpy (&packet[off], &icmp_ttl, sizeof (struct icmp_ttl_exceeded_header)); | 406 | GNUNET_memcpy (&packet[off], &icmp_ttl, sizeof (struct icmp_ttl_exceeded_header)); |
407 | 407 | ||
408 | memset (&dst, 0, sizeof (dst)); | 408 | memset (&dst, 0, sizeof (dst)); |
409 | dst.sin_family = AF_INET; | 409 | dst.sin_family = AF_INET; |