diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-21 22:34:17 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-21 22:34:17 +0000 |
commit | 1355ed0acd88356beccc25dfc710ef0d458b5b96 (patch) | |
tree | 9f9b038f4313c39cc7360d9d7a73ca824da0bc83 /src/transport/gnunet-nat-server.c | |
parent | 59303b47a266fa1b40da6725f2cac5f29f358cbe (diff) | |
download | gnunet-1355ed0acd88356beccc25dfc710ef0d458b5b96.tar.gz gnunet-1355ed0acd88356beccc25dfc710ef0d458b5b96.zip |
cleaning
Diffstat (limited to 'src/transport/gnunet-nat-server.c')
-rw-r--r-- | src/transport/gnunet-nat-server.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/transport/gnunet-nat-server.c b/src/transport/gnunet-nat-server.c index 905a08337..5cedb35e3 100644 --- a/src/transport/gnunet-nat-server.c +++ b/src/transport/gnunet-nat-server.c | |||
@@ -244,8 +244,8 @@ send_icmp_echo (const struct in_addr *my_ip) | |||
244 | off = 0; | 244 | off = 0; |
245 | ip_pkt.vers_ihl = 0x45; | 245 | ip_pkt.vers_ihl = 0x45; |
246 | ip_pkt.tos = 0; | 246 | ip_pkt.tos = 0; |
247 | ip_pkt.pkt_len = sizeof (packet); | 247 | ip_pkt.pkt_len = htons (sizeof (packet)); |
248 | ip_pkt.id = 1; | 248 | ip_pkt.id = htons (256); |
249 | ip_pkt.flags_frag_offset = 0; | 249 | ip_pkt.flags_frag_offset = 0; |
250 | ip_pkt.ttl = IPDEFTTL; | 250 | ip_pkt.ttl = IPDEFTTL; |
251 | ip_pkt.proto = IPPROTO_ICMP; | 251 | ip_pkt.proto = IPPROTO_ICMP; |
@@ -279,7 +279,7 @@ send_icmp_echo (const struct in_addr *my_ip) | |||
279 | err = sendto(rawsock, | 279 | err = sendto(rawsock, |
280 | packet, off, 0, | 280 | packet, off, 0, |
281 | (struct sockaddr*)&dst, | 281 | (struct sockaddr*)&dst, |
282 | sizeof(struct sockaddr_in)); | 282 | sizeof(dst)); |
283 | if (err < 0) | 283 | if (err < 0) |
284 | { | 284 | { |
285 | #if VERBOSE | 285 | #if VERBOSE |
@@ -297,8 +297,6 @@ send_icmp_echo (const struct in_addr *my_ip) | |||
297 | 297 | ||
298 | /** | 298 | /** |
299 | * Send a UDP message to the dummy IP. | 299 | * Send a UDP message to the dummy IP. |
300 | * | ||
301 | * @param my_ip source address (our ip address) | ||
302 | */ | 300 | */ |
303 | static void | 301 | static void |
304 | send_udp () | 302 | send_udp () |
@@ -346,7 +344,7 @@ process_icmp_response () | |||
346 | struct icmp_echo_header icmp_echo; | 344 | struct icmp_echo_header icmp_echo; |
347 | struct udp_header udp_pkt; | 345 | struct udp_header udp_pkt; |
348 | size_t off; | 346 | size_t off; |
349 | uint32_t port; | 347 | uint16_t port; |
350 | 348 | ||
351 | have = read (icmpsock, buf, sizeof (buf)); | 349 | have = read (icmpsock, buf, sizeof (buf)); |
352 | if (-1 == have) | 350 | if (-1 == have) |
@@ -434,12 +432,12 @@ process_icmp_response () | |||
434 | sizeof (buf))); | 432 | sizeof (buf))); |
435 | else | 433 | else |
436 | fprintf (stdout, | 434 | fprintf (stdout, |
437 | "%s:%d\n", | 435 | "%s:%u\n", |
438 | inet_ntop (AF_INET, | 436 | inet_ntop (AF_INET, |
439 | &source_ip, | 437 | &source_ip, |
440 | buf, | 438 | buf, |
441 | sizeof (buf)), | 439 | sizeof (buf)), |
442 | port); | 440 | (unsigned int) port); |
443 | fflush (stdout); | 441 | fflush (stdout); |
444 | } | 442 | } |
445 | 443 | ||
@@ -523,6 +521,7 @@ make_raw_socket () | |||
523 | /** | 521 | /** |
524 | * Create a UDP socket for writinging. | 522 | * Create a UDP socket for writinging. |
525 | * | 523 | * |
524 | * @param my_ip source address (our ip address) | ||
526 | * @return -1 on error | 525 | * @return -1 on error |
527 | */ | 526 | */ |
528 | static int | 527 | static int |