gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6256 - in GNUnet/src/transports: . upnp


From: gnunet
Subject: [GNUnet-SVN] r6256 - in GNUnet/src/transports: . upnp
Date: Mon, 11 Feb 2008 21:51:10 -0700 (MST)

Author: grothoff
Date: 2008-02-11 21:51:10 -0700 (Mon, 11 Feb 2008)
New Revision: 6256

Modified:
   GNUnet/src/transports/common.c
   GNUnet/src/transports/upnp/util.c
Log:
v6

Modified: GNUnet/src/transports/common.c
===================================================================
--- GNUnet/src/transports/common.c      2008-02-12 04:50:56 UTC (rev 6255)
+++ GNUnet/src/transports/common.c      2008-02-12 04:51:10 UTC (rev 6256)
@@ -422,7 +422,7 @@
 {
   const HostAddress *haddr = (const HostAddress *) &hello[1];
   struct sockaddr_in *serverAddr4;
-  struct sockaddr_in *serverAddr6;
+  struct sockaddr_in6 *serverAddr6;
   unsigned short available;
   
   available = ntohs(haddr->availability);
@@ -442,9 +442,9 @@
       serverAddr6 = GNUNET_malloc (sizeof (struct sockaddr_in6));
       *sa = serverAddr6;
       memset (serverAddr6, 0, sizeof (struct sockaddr_in6));
-      serverAddr6->sin_family = AF_INET6;
-      memcpy (&serverAddr6->sin_addr, &haddr->ipv6, sizeof 
(GNUNET_IPv6Address));
-      serverAddr6->sin_port = haddr->port;
+      serverAddr6->sin6_family = AF_INET6;
+      memcpy (&serverAddr6->sin6_addr, &haddr->ipv6, sizeof 
(GNUNET_IPv6Address));
+      serverAddr6->sin6_port = haddr->port;
     }
   else
     return GNUNET_SYSERR;

Modified: GNUnet/src/transports/upnp/util.c
===================================================================
--- GNUnet/src/transports/upnp/util.c   2008-02-12 04:50:56 UTC (rev 6255)
+++ GNUnet/src/transports/upnp/util.c   2008-02-12 04:51:10 UTC (rev 6256)
@@ -33,6 +33,8 @@
   const char *pln;
   int len;
   int pound;
+  char b[7];
+  char * buf;
 
   if (!text || *text != '&')
     return NULL;
@@ -58,11 +60,10 @@
   else if (*(text + 1) == '#' && (sscanf (text, "&#%u;", &pound) == 1) &&
            pound != 0 && *(text + 3 + (int) log10 (pound)) == ';')
     {
-      char b[7];
-      char *buf = GNUNET_convert_string_to_utf8 (NULL,
-                                                 (const char *) &pound,
-                                                 2,
-                                                 "UNICODE");
+      buf = GNUNET_convert_string_to_utf8 (NULL,
+                                          (const char *) &pound,
+                                          2,
+                                          "UNICODE");
       if (strlen (buf) > 6)
         buf[6] = '\0';
       strcpy (b, buf);





reply via email to

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