renaming
authorChristian Grothoff <christian@grothoff.org>
Sat, 21 Aug 2010 22:04:27 +0000 (22:04 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 21 Aug 2010 22:04:27 +0000 (22:04 +0000)
src/transport/gnunet-nat-client.c
src/transport/gnunet-nat-server.c

index 1f88f7b8f571ac41064014d5111de42ff744be19..0ab29dff85717c40926bef5095966523ad3951e2 100644 (file)
@@ -324,7 +324,7 @@ send_icmp (const struct in_addr *my_ip,
           const struct in_addr *other)
 {
   struct ip_header ip_pkt;
-  struct icmp_ttl_exceeded_header icmp_pkt;
+  struct icmp_ttl_exceeded_header icmp_ttl;
   struct icmp_echo_header icmp_echo;
   struct sockaddr_in dst;
   char packet[sizeof (struct ip_header) * 2 +
@@ -353,12 +353,12 @@ send_icmp (const struct in_addr *my_ip,
   off = sizeof (ip_pkt);
 
   /* icmp reply: time exceeded */
-  icmp_pkt.type = ICMP_TIME_EXCEEDED;
-  icmp_pkt.code = 0; 
-  icmp_pkt.checksum = 0;
-  icmp_pkt.unused = 0;
+  icmp_ttl.type = ICMP_TIME_EXCEEDED;
+  icmp_ttl.code = 0; 
+  icmp_ttl.checksum = 0;
+  icmp_ttl.unused = 0;
   memcpy (&packet[off],
-         &icmp_pkt,
+         &icmp_ttl,
          sizeof (struct icmp_ttl_exceeded_header));
   off += sizeof (struct icmp_ttl_exceeded_header);
 
@@ -392,12 +392,12 @@ send_icmp (const struct in_addr *my_ip,
 
   /* no go back to calculate ICMP packet checksum */
   off = sizeof (struct ip_header);
-  icmp_pkt.checksum = htons(calc_checksum((uint16_t*) &packet[off],
+  icmp_ttl.checksum = htons(calc_checksum((uint16_t*) &packet[off],
                                          sizeof (struct icmp_ttl_exceeded_header) + 
                                          sizeof(struct ip_header) + 
                                          sizeof(struct icmp_echo_header)));
   memcpy (&packet[off],
-         &icmp_pkt,
+         &icmp_ttl,
          sizeof (struct icmp_ttl_exceeded_header));
 
   /* prepare for transmission */
index 0bdd4108bcb43b1130d6035e7b8b222512e11f2e..905a08337bab9697e2bb0c0f24a147027352fb25 100644 (file)
@@ -342,8 +342,8 @@ process_icmp_response ()
   ssize_t have;
   struct in_addr source_ip;
   struct ip_header ip_pkt;
-  struct icmp_ttl_exceeded_header icmp_pkt;
-  struct icmp_echo_header icmp_echo_pkt;
+  struct icmp_ttl_exceeded_header icmp_ttl;
+  struct icmp_echo_header icmp_echo;
   struct udp_header udp_pkt;
   size_t off;
   uint32_t port;
@@ -361,7 +361,7 @@ process_icmp_response ()
            "Received message of %u bytes\n",
            (unsigned int) have);
 #endif
-  if (have < sizeof (struct ip_header) + sizeof (struct icmp_ttl_exceeded_header) + sizeof (struct ip_header) )
+  if (have < (ssize_t) (sizeof (struct ip_header) + sizeof (struct icmp_ttl_exceeded_header) + sizeof (struct ip_header)))
     {
       /* malformed */
       return;
@@ -374,12 +374,12 @@ process_icmp_response ()
   memcpy(&source_ip, 
         &ip_pkt.src_ip, 
         sizeof (source_ip));
-  memcpy (&icmp_pkt
+  memcpy (&icmp_ttl
          &buf[off], 
          sizeof (struct icmp_ttl_exceeded_header));
   off += sizeof (struct icmp_ttl_exceeded_header);
-  if ( (ICMP_TIME_EXCEEDED != icmp_pkt.type) || 
-       (0 != icmp_pkt.code) )
+  if ( (ICMP_TIME_EXCEEDED != icmp_ttl.type) || 
+       (0 != icmp_ttl.code) )
     {
       /* different type than what we want */
       return;
@@ -401,10 +401,10 @@ process_icmp_response ()
          return;
        }
       /* grab ICMP ECHO content */
-      memcpy (&icmp_echo_pkt,
+      memcpy (&icmp_echo,
              &buf[off],
              sizeof (struct icmp_echo_header));
-      port = (uint16_t)  ntohl (icmp_echo_pkt.reserved);
+      port = (uint16_t)  ntohl (icmp_echo.reserved);
       break;
     case IPPROTO_UDP:
       if (have != (sizeof (struct ip_header) * 2 +