diff options
Diffstat (limited to 'src/nat/gnunet-helper-nat-server-windows.c')
-rw-r--r-- | src/nat/gnunet-helper-nat-server-windows.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nat/gnunet-helper-nat-server-windows.c b/src/nat/gnunet-helper-nat-server-windows.c index 97e04e5f1..c8e1193e4 100644 --- a/src/nat/gnunet-helper-nat-server-windows.c +++ b/src/nat/gnunet-helper-nat-server-windows.c | |||
@@ -284,7 +284,7 @@ send_icmp_echo (const struct in_addr *my_ip) | |||
284 | ip_pkt.dst_ip = dummy.s_addr; | 284 | ip_pkt.dst_ip = dummy.s_addr; |
285 | ip_pkt.checksum = | 285 | ip_pkt.checksum = |
286 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); | 286 | htons (calc_checksum ((uint16_t *) & ip_pkt, sizeof (struct ip_header))); |
287 | memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); | 287 | GNUNET_memcpy (&packet[off], &ip_pkt, sizeof (struct ip_header)); |
288 | off += sizeof (struct ip_header); | 288 | off += sizeof (struct ip_header); |
289 | 289 | ||
290 | icmp_echo.type = ICMP_ECHO; | 290 | icmp_echo.type = ICMP_ECHO; |
@@ -294,7 +294,7 @@ send_icmp_echo (const struct in_addr *my_ip) | |||
294 | icmp_echo.checksum = | 294 | icmp_echo.checksum = |
295 | htons (calc_checksum | 295 | htons (calc_checksum |
296 | ((uint16_t *) & icmp_echo, sizeof (struct icmp_echo_header))); | 296 | ((uint16_t *) & icmp_echo, sizeof (struct icmp_echo_header))); |
297 | memcpy (&packet[off], &icmp_echo, sizeof (struct icmp_echo_header)); | 297 | GNUNET_memcpy (&packet[off], &icmp_echo, sizeof (struct icmp_echo_header)); |
298 | off += sizeof (struct icmp_echo_header); | 298 | off += sizeof (struct icmp_echo_header); |
299 | 299 | ||
300 | memset (&dst, 0, sizeof (dst)); | 300 | memset (&dst, 0, sizeof (dst)); |
@@ -377,10 +377,10 @@ process_icmp_response () | |||
377 | return; | 377 | return; |
378 | } | 378 | } |
379 | off = 0; | 379 | off = 0; |
380 | memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); | 380 | GNUNET_memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); |
381 | off += sizeof (struct ip_header); | 381 | off += sizeof (struct ip_header); |
382 | memcpy (&source_ip, &ip_pkt.src_ip, sizeof (source_ip)); | 382 | GNUNET_memcpy (&source_ip, &ip_pkt.src_ip, sizeof (source_ip)); |
383 | memcpy (&icmp_ttl, &buf[off], sizeof (struct icmp_ttl_exceeded_header)); | 383 | GNUNET_memcpy (&icmp_ttl, &buf[off], sizeof (struct icmp_ttl_exceeded_header)); |
384 | off += sizeof (struct icmp_ttl_exceeded_header); | 384 | off += sizeof (struct icmp_ttl_exceeded_header); |
385 | if ((ICMP_TIME_EXCEEDED != icmp_ttl.type) || (0 != icmp_ttl.code)) | 385 | if ((ICMP_TIME_EXCEEDED != icmp_ttl.type) || (0 != icmp_ttl.code)) |
386 | { | 386 | { |
@@ -388,7 +388,7 @@ process_icmp_response () | |||
388 | return; | 388 | return; |
389 | } | 389 | } |
390 | /* skip 2nd IP header */ | 390 | /* skip 2nd IP header */ |
391 | memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); | 391 | GNUNET_memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); |
392 | off += sizeof (struct ip_header); | 392 | off += sizeof (struct ip_header); |
393 | 393 | ||
394 | switch (ip_pkt.proto) | 394 | switch (ip_pkt.proto) |
@@ -403,7 +403,7 @@ process_icmp_response () | |||
403 | return; | 403 | return; |
404 | } | 404 | } |
405 | /* grab ICMP ECHO content */ | 405 | /* grab ICMP ECHO content */ |
406 | memcpy (&icmp_echo, &buf[off], sizeof (struct icmp_echo_header)); | 406 | GNUNET_memcpy (&icmp_echo, &buf[off], sizeof (struct icmp_echo_header)); |
407 | port = (uint16_t) ntohl (icmp_echo.reserved); | 407 | port = (uint16_t) ntohl (icmp_echo.reserved); |
408 | break; | 408 | break; |
409 | case IPPROTO_UDP: | 409 | case IPPROTO_UDP: |
@@ -415,7 +415,7 @@ process_icmp_response () | |||
415 | return; | 415 | return; |
416 | } | 416 | } |
417 | /* grab UDP content */ | 417 | /* grab UDP content */ |
418 | memcpy (&udp_pkt, &buf[off], sizeof (struct udp_header)); | 418 | GNUNET_memcpy (&udp_pkt, &buf[off], sizeof (struct udp_header)); |
419 | port = ntohs (udp_pkt.length); | 419 | port = ntohs (udp_pkt.length); |
420 | break; | 420 | break; |
421 | default: | 421 | default: |