diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-21 22:04:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-21 22:04:27 +0000 |
commit | 59303b47a266fa1b40da6725f2cac5f29f358cbe (patch) | |
tree | 242a094b60b3198896d44ca0c565c701111f027d /src/transport/gnunet-nat-server.c | |
parent | cc7f12f40748c96953af708f9cb9408d230a2892 (diff) | |
download | gnunet-59303b47a266fa1b40da6725f2cac5f29f358cbe.tar.gz gnunet-59303b47a266fa1b40da6725f2cac5f29f358cbe.zip |
renaming
Diffstat (limited to 'src/transport/gnunet-nat-server.c')
-rw-r--r-- | src/transport/gnunet-nat-server.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/transport/gnunet-nat-server.c b/src/transport/gnunet-nat-server.c index 0bdd4108b..905a08337 100644 --- a/src/transport/gnunet-nat-server.c +++ b/src/transport/gnunet-nat-server.c | |||
@@ -342,8 +342,8 @@ process_icmp_response () | |||
342 | ssize_t have; | 342 | ssize_t have; |
343 | struct in_addr source_ip; | 343 | struct in_addr source_ip; |
344 | struct ip_header ip_pkt; | 344 | struct ip_header ip_pkt; |
345 | struct icmp_ttl_exceeded_header icmp_pkt; | 345 | struct icmp_ttl_exceeded_header icmp_ttl; |
346 | struct icmp_echo_header icmp_echo_pkt; | 346 | struct icmp_echo_header icmp_echo; |
347 | struct udp_header udp_pkt; | 347 | struct udp_header udp_pkt; |
348 | size_t off; | 348 | size_t off; |
349 | uint32_t port; | 349 | uint32_t port; |
@@ -361,7 +361,7 @@ process_icmp_response () | |||
361 | "Received message of %u bytes\n", | 361 | "Received message of %u bytes\n", |
362 | (unsigned int) have); | 362 | (unsigned int) have); |
363 | #endif | 363 | #endif |
364 | if (have < sizeof (struct ip_header) + sizeof (struct icmp_ttl_exceeded_header) + sizeof (struct ip_header) ) | 364 | if (have < (ssize_t) (sizeof (struct ip_header) + sizeof (struct icmp_ttl_exceeded_header) + sizeof (struct ip_header))) |
365 | { | 365 | { |
366 | /* malformed */ | 366 | /* malformed */ |
367 | return; | 367 | return; |
@@ -374,12 +374,12 @@ process_icmp_response () | |||
374 | memcpy(&source_ip, | 374 | memcpy(&source_ip, |
375 | &ip_pkt.src_ip, | 375 | &ip_pkt.src_ip, |
376 | sizeof (source_ip)); | 376 | sizeof (source_ip)); |
377 | memcpy (&icmp_pkt, | 377 | memcpy (&icmp_ttl, |
378 | &buf[off], | 378 | &buf[off], |
379 | sizeof (struct icmp_ttl_exceeded_header)); | 379 | sizeof (struct icmp_ttl_exceeded_header)); |
380 | off += sizeof (struct icmp_ttl_exceeded_header); | 380 | off += sizeof (struct icmp_ttl_exceeded_header); |
381 | if ( (ICMP_TIME_EXCEEDED != icmp_pkt.type) || | 381 | if ( (ICMP_TIME_EXCEEDED != icmp_ttl.type) || |
382 | (0 != icmp_pkt.code) ) | 382 | (0 != icmp_ttl.code) ) |
383 | { | 383 | { |
384 | /* different type than what we want */ | 384 | /* different type than what we want */ |
385 | return; | 385 | return; |
@@ -401,10 +401,10 @@ process_icmp_response () | |||
401 | return; | 401 | return; |
402 | } | 402 | } |
403 | /* grab ICMP ECHO content */ | 403 | /* grab ICMP ECHO content */ |
404 | memcpy (&icmp_echo_pkt, | 404 | memcpy (&icmp_echo, |
405 | &buf[off], | 405 | &buf[off], |
406 | sizeof (struct icmp_echo_header)); | 406 | sizeof (struct icmp_echo_header)); |
407 | port = (uint16_t) ntohl (icmp_echo_pkt.reserved); | 407 | port = (uint16_t) ntohl (icmp_echo.reserved); |
408 | break; | 408 | break; |
409 | case IPPROTO_UDP: | 409 | case IPPROTO_UDP: |
410 | if (have != (sizeof (struct ip_header) * 2 + | 410 | if (have != (sizeof (struct ip_header) * 2 + |