Author: grothoff Date: 2008-02-23 23:39:01 -0700 (Sat, 23 Feb 2008) New Revision: 6426
Modified: GNUnet/src/transports/http.c GNUnet/src/transports/ip.c Log: default to v4 Modified: GNUnet/src/transports/http.c =================================================================== --- GNUnet/src/transports/http.c 2008-02-24 05:22:43 UTC (rev 6425) +++ GNUnet/src/transports/http.c 2008-02-24 06:39:01 UTC (rev 6426) @@ -1121,30 +1121,30 @@ { GNUNET_hash_to_enc (&coreAPI->myIdentity->hashPubKey, &enc); available = ntohs (haddr->availability) & available_protocols; - if (available == 0) - return; - if ((available & VERSION_AVAILABLE_IPV6) > 0) + if ((available & VERSION_AVAILABLE_IPV4) > 0) { - if (NULL == inet_ntop (AF_INET6, &haddr->ipv6, buf, IP_BUF_LEN)) + if (NULL == inet_ntop (AF_INET, &haddr->ipv4, buf, IP_BUF_LEN)) { /* log? */ EXIT (); return; } - obr = "["; - cbr = "]"; + obr = ""; + cbr = ""; } - else + else if ((available & VERSION_AVAILABLE_IPV6) > 0) { - if (NULL == inet_ntop (AF_INET, &haddr->ipv4, buf, IP_BUF_LEN)) + if (NULL == inet_ntop (AF_INET6, &haddr->ipv6, buf, IP_BUF_LEN)) { /* log? */ EXIT (); return; } - obr = ""; - cbr = ""; + obr = "["; + cbr = "]"; } + else + return; /* error */ url = GNUNET_malloc (64 + sizeof (GNUNET_EncName) + strlen (buf)); GNUNET_snprintf (url, 64 + sizeof (GNUNET_EncName), Modified: GNUnet/src/transports/ip.c =================================================================== --- GNUnet/src/transports/ip.c 2008-02-24 05:22:43 UTC (rev 6425) +++ GNUnet/src/transports/ip.c 2008-02-24 06:39:01 UTC (rev 6426) @@ -288,8 +288,8 @@ if (ifa_ptr->ifa_addr->sa_family != AF_INET6) continue; memcpy (identity, - &(((struct sockaddr_in6 *) ifa_ptr->ifa_addr)-> - sin6_addr), sizeof (struct in6_addr)); + &((struct sockaddr_in6 *) ifa_ptr->ifa_addr)->sin6_addr, + sizeof (struct in6_addr)); freeifaddrs (ifa_first); GNUNET_free (interfaces); return GNUNET_OK; _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn