GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR |
GNUNET_ERROR_TYPE_BULK, "gethostname");
- return NULL;
+ return;
}
#if DEBUG_RESOLVER
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not resolve our FQDN : %s %u\n"),
hstrerror (h_errno), h_errno);
- return NULL;
+ return;
}
GNUNET_assert( 0 != host);
GNUNET_assert( 0 == result);
}
-static void
-check_local_hostname(void *cls, const char *hostname)
-{
- int result = 0;
-
- char own_hostname[GNUNET_OS_get_hostname_max_length() + 1];
-#if DEBUG_RESOLVER
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Hostname resolved here is `%s'.\n", own_hostname);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Hostname resolved using resolver is `%s'.\n", hostname);
-#endif
-
- result = gethostname (own_hostname, sizeof (own_hostname) - 1);
-
- if ( 0 != result )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Could not resolve local hostname\n", own_hostname);
- }
- GNUNET_assert( 0 == result);
-
- result = strcmp(hostname, own_hostname);
- if ( 0 != result )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Local resolved and resolver resolved hostnames are not equal\n", own_hostname);
- }
- GNUNET_assert( 0 == result);
-}
static void
run(void *cls, struct GNUNET_SCHEDULER_Handle *sched, char * const *args,
const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
{
+ int *ok = cls;
struct sockaddr_in sa;
struct GNUNET_TIME_Relative timeout = GNUNET_TIME_relative_multiply(
GNUNET_TIME_UNIT_MILLISECONDS, 2500);
int count_ips = 0;
- char * own_hostname;
char * own_fqdn;
memset(&sa, 0, sizeof(sa));
GNUNET_RESOLVER_hostname_resolve(sched, cfg, AF_UNSPEC, timeout,
&check_hostname, cls);
- /*
- * Looking up our own hostname
- */
- own_hostname = GNUNET_RESOLVER_local_hostname_get();
- check_local_hostname( NULL, own_hostname);
- GNUNET_free (own_hostname);
/*
* Looking up our own fqdn
* DNS rootserver to test: a.root-servers.net - 198.41.0.4
*/
- char const * rootserver_name = ROOTSERVER_NAME;
+ const char * rootserver_name = ROOTSERVER_NAME;
struct hostent *rootserver;
rootserver = gethostbyname(rootserver_name);
_("gethostbyname() could not lookup IP address: %s\n"),
hstrerror (h_errno));
#endif
- GNUNET_break(0);
+ fprintf (stderr,
+ "System seems to be off-line, will not run all DNS tests\n");
+ *ok = 0; /* mark test as passing anyway */
return;
}