gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19298 - gnunet/src/exit


From: gnunet
Subject: [GNUnet-SVN] r19298 - gnunet/src/exit
Date: Sat, 21 Jan 2012 17:17:23 +0100

Author: grothoff
Date: 2012-01-21 17:17:23 +0100 (Sat, 21 Jan 2012)
New Revision: 19298

Modified:
   gnunet/src/exit/gnunet-daemon-exit.c
Log:
-misc bugfixes for ICMP

Modified: gnunet/src/exit/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/exit/gnunet-daemon-exit.c        2012-01-21 15:11:58 UTC (rev 
19297)
+++ gnunet/src/exit/gnunet-daemon-exit.c        2012-01-21 16:17:23 UTC (rev 
19298)
@@ -602,7 +602,7 @@
                           source_ip,
                           sbuf, sizeof (sbuf)),
                inet_ntop (af,
-                          source_ip,
+                          destination_ip,
                           dbuf, sizeof (dbuf)));    
   }
   if (pktlen < sizeof (struct GNUNET_TUN_IcmpHeader))
@@ -721,7 +721,7 @@
   if (NULL == state)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-               _("Packet dropped, have no matching connection information\n"));
+               _("ICMP Packet dropped, have no matching connection 
information\n"));
     return;
   }
   mlen = sizeof (struct GNUNET_EXIT_IcmpToVPNMessage) + pktlen - sizeof 
(struct GNUNET_TUN_IcmpHeader);
@@ -779,7 +779,7 @@
                           sbuf, sizeof (sbuf)),
                (unsigned int) ntohs (udp->spt),
                inet_ntop (af,
-                          source_ip,
+                          destination_ip,
                           dbuf, sizeof (dbuf)),
                (unsigned int) ntohs (udp->dpt));
   }
@@ -804,7 +804,7 @@
   if (NULL == state)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-               _("Packet dropped, have no matching connection information\n"));
+               _("UDP Packet dropped, have no matching connection 
information\n"));
     return;
   }
   mlen = sizeof (struct GNUNET_EXIT_UdpReplyMessage) + pktlen - sizeof (struct 
GNUNET_TUN_UdpHeader);
@@ -879,7 +879,7 @@
   if (NULL == state)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-               _("Packet dropped, have no matching connection information\n"));
+               _("TCP Packet dropped, have no matching connection 
information\n"));
     
     return;
   }
@@ -1074,9 +1074,12 @@
   local_address->proto = (uint8_t) proto;
   /* default "local" port range is often 32768--61000,
      so we pick a random value in that range */         
-  local_address->port 
-    = (uint16_t) 32768 + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 
-                                                  28232);      
+  if (proto == IPPROTO_ICMP)
+    local_address->port = 0;
+  else
+    local_address->port 
+      = (uint16_t) 32768 + GNUNET_CRYPTO_random_u32 
(GNUNET_CRYPTO_QUALITY_WEAK, 
+                                                    28232);      
   switch (af)
   {
   case AF_INET:
@@ -1205,7 +1208,7 @@
                inet_ntop (state->ri.local_address.af, 
                           &state->ri.local_address.address,
                           buf, sizeof (buf)),
-               (unsigned int) state->ri.local_address.port);  
+               (unsigned int) state->ri.local_address.port);
   }
   state->state_key = key;
   GNUNET_assert (GNUNET_OK ==




reply via email to

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