gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12705 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r12705 - gnunet/src/transport
Date: Sun, 22 Aug 2010 00:04:27 +0200

Author: grothoff
Date: 2010-08-22 00:04:27 +0200 (Sun, 22 Aug 2010)
New Revision: 12705

Modified:
   gnunet/src/transport/gnunet-nat-client.c
   gnunet/src/transport/gnunet-nat-server.c
Log:
renaming

Modified: gnunet/src/transport/gnunet-nat-client.c
===================================================================
--- gnunet/src/transport/gnunet-nat-client.c    2010-08-21 21:58:51 UTC (rev 
12704)
+++ gnunet/src/transport/gnunet-nat-client.c    2010-08-21 22:04:27 UTC (rev 
12705)
@@ -324,7 +324,7 @@
           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 @@
   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 @@
 
   /* 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 */

Modified: gnunet/src/transport/gnunet-nat-server.c
===================================================================
--- gnunet/src/transport/gnunet-nat-server.c    2010-08-21 21:58:51 UTC (rev 
12704)
+++ gnunet/src/transport/gnunet-nat-server.c    2010-08-21 22:04:27 UTC (rev 
12705)
@@ -342,8 +342,8 @@
   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 @@
            "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 @@
   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 @@
          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 + 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]