windoze suckssss
authorNathan S. Evans <evans@in.tum.de>
Wed, 18 Aug 2010 16:11:05 +0000 (16:11 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 18 Aug 2010 16:11:05 +0000 (16:11 +0000)
src/transport/gnunet-nat-client-windows.c

index a9c38ddb2188237fad8ebe2fe73f4ac870623516..7f992a550a5aa07d9e0e73af32d2884244580a81 100644 (file)
@@ -180,6 +180,18 @@ make_echo (const struct in_addr *src_ip,
                                       sizeof (struct icmp_echo_packet)));
 }
 
+static void
+make_echo2 (const struct in_addr *src_ip,
+           struct icmp_packet *echo)
+{
+  memset(echo, 0, sizeof(struct icmp_packet));
+  echo->type = ICMP_ECHO;
+  echo->code = 0;
+  echo->reserved = 0;
+  echo->checksum = 0;
+  echo->checksum = htons(calc_checksum((uint16_t*)echo, sizeof (struct icmp_packet)));
+}
+
 /**
  * Send an ICMP message to the dummy IP.
  *
@@ -211,7 +223,7 @@ send_icmp_echo (const struct in_addr *my_ip)
   ip_pkt.checksum = htons(calc_checksum((uint16_t*)&ip_pkt, sizeof (ip_pkt)));
   memcpy (packet, &ip_pkt, sizeof (ip_pkt));
   off += sizeof (ip_pkt);
-  make_echo (my_ip, &icmp_echo);
+  make_echo2 (my_ip, &icmp_echo);
   memcpy (&packet[off], &icmp_echo, sizeof (icmp_echo));
   off += sizeof (icmp_echo);