diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-08-23 12:28:24 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-08-23 12:28:24 +0000 |
commit | cbfa5727ef857862d8c79d99cbaf60e504d8c2a0 (patch) | |
tree | 1e477582cabe076955f25ca3ff041ffaf8b85fed /src/transport/gnunet-nat-client-windows.c | |
parent | 30308a96fff9ed1509d2dbd6fbd830ba42c475ef (diff) | |
download | gnunet-cbfa5727ef857862d8c79d99cbaf60e504d8c2a0.tar.gz gnunet-cbfa5727ef857862d8c79d99cbaf60e504d8c2a0.zip |
make windows client work
Diffstat (limited to 'src/transport/gnunet-nat-client-windows.c')
-rw-r--r-- | src/transport/gnunet-nat-client-windows.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/transport/gnunet-nat-client-windows.c b/src/transport/gnunet-nat-client-windows.c index 2507a96b4..911f4962a 100644 --- a/src/transport/gnunet-nat-client-windows.c +++ b/src/transport/gnunet-nat-client-windows.c | |||
@@ -382,8 +382,8 @@ send_icmp (const struct in_addr *my_ip, | |||
382 | /* icmp reply: time exceeded */ | 382 | /* icmp reply: time exceeded */ |
383 | icmp_ttl.type = ICMP_TIME_EXCEEDED; | 383 | icmp_ttl.type = ICMP_TIME_EXCEEDED; |
384 | icmp_ttl.code = 0; | 384 | icmp_ttl.code = 0; |
385 | icmp_ttl.reserved = 0; | ||
386 | icmp_ttl.checksum = 0; | 385 | icmp_ttl.checksum = 0; |
386 | icmp_ttl.unused = 0; | ||
387 | memcpy (&packet[off], | 387 | memcpy (&packet[off], |
388 | &icmp_ttl, | 388 | &icmp_ttl, |
389 | sizeof (struct icmp_ttl_exceeded_header)); | 389 | sizeof (struct icmp_ttl_exceeded_header)); |
@@ -392,7 +392,7 @@ send_icmp (const struct in_addr *my_ip, | |||
392 | /* ip header of the presumably 'lost' udp packet */ | 392 | /* ip header of the presumably 'lost' udp packet */ |
393 | ip_pkt.vers_ihl = 0x45; | 393 | ip_pkt.vers_ihl = 0x45; |
394 | ip_pkt.tos = 0; | 394 | ip_pkt.tos = 0; |
395 | ip_pkt.pkt_len = (sizeof (struct ip_header) + sizeof (struct icmp_echo_header)); | 395 | ip_pkt.pkt_len = htons(sizeof (struct ip_header) + sizeof (struct icmp_echo_header)); |
396 | ip_pkt.id = htons (256); | 396 | ip_pkt.id = htons (256); |
397 | ip_pkt.flags_frag_offset = 0; | 397 | ip_pkt.flags_frag_offset = 0; |
398 | ip_pkt.ttl = 1; /* real TTL would be 1 on a time exceeded packet */ | 398 | ip_pkt.ttl = 1; /* real TTL would be 1 on a time exceeded packet */ |
@@ -409,9 +409,8 @@ send_icmp (const struct in_addr *my_ip, | |||
409 | 409 | ||
410 | icmp_echo.type = ICMP_ECHO; | 410 | icmp_echo.type = ICMP_ECHO; |
411 | icmp_echo.code = 0; | 411 | icmp_echo.code = 0; |
412 | icmp_echo.reserved = 0; | 412 | icmp_echo.reserved = htonl(port); |
413 | icmp_echo.checksum = 0; | 413 | icmp_echo.checksum = 0; |
414 | icmp_echo.data = htons(port); | ||
415 | icmp_echo.checksum = htons(calc_checksum((uint16_t*) &icmp_echo, | 414 | icmp_echo.checksum = htons(calc_checksum((uint16_t*) &icmp_echo, |
416 | sizeof (struct icmp_echo_header))); | 415 | sizeof (struct icmp_echo_header))); |
417 | memcpy (&packet[off], | 416 | memcpy (&packet[off], |