diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-29 08:00:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-29 08:00:26 +0000 |
commit | 65f518e8036699fa3c574266d39e3cd1263af9e8 (patch) | |
tree | 7564ed41e2620563bfa7e6dc89dac98cde4c88a1 /src/util/test_resolver_api.c | |
parent | 2a6b06943962c4978a0afb89f1eed141e142a76f (diff) | |
download | gnunet-65f518e8036699fa3c574266d39e3cd1263af9e8.tar.gz gnunet-65f518e8036699fa3c574266d39e3cd1263af9e8.zip |
-fix #3870
Diffstat (limited to 'src/util/test_resolver_api.c')
-rw-r--r-- | src/util/test_resolver_api.c | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index 1979067f0..0652625f5 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -137,45 +137,6 @@ check_127 (void *cls, const struct sockaddr *sa, socklen_t salen) | |||
137 | 137 | ||
138 | 138 | ||
139 | static void | 139 | static void |
140 | check_local_fqdn (void *cls, const char *gnunet_fqdn) | ||
141 | { | ||
142 | int result = 0; | ||
143 | |||
144 | struct hostent *host; | ||
145 | char hostname[GNUNET_OS_get_hostname_max_length () + 1]; | ||
146 | |||
147 | if (0 != gethostname (hostname, sizeof (hostname) - 1)) | ||
148 | { | ||
149 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | ||
150 | "gethostname"); | ||
151 | return; | ||
152 | } | ||
153 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
154 | "Resolving our FQDN `%s'\n", | ||
155 | hostname); | ||
156 | host = gethostbyname (hostname); | ||
157 | if (NULL == host) | ||
158 | { | ||
159 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
160 | "Could not resolve our FQDN: %s %u\n", | ||
161 | hstrerror (h_errno), | ||
162 | h_errno); | ||
163 | return; | ||
164 | } | ||
165 | |||
166 | GNUNET_assert (0 != host); | ||
167 | |||
168 | result = strcmp (host->h_name, gnunet_fqdn); | ||
169 | if (0 != result) | ||
170 | { | ||
171 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
172 | "Local resolved and resolver resolved fqdns are not equal\n"); | ||
173 | } | ||
174 | GNUNET_assert (0 == result); | ||
175 | } | ||
176 | |||
177 | |||
178 | static void | ||
179 | check_rootserver_ip (void *cls, const struct sockaddr *sa, socklen_t salen) | 140 | check_rootserver_ip (void *cls, const struct sockaddr *sa, socklen_t salen) |
180 | { | 141 | { |
181 | int *ok = cls; | 142 | int *ok = cls; |
@@ -252,7 +213,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
252 | * Looking up our own fqdn | 213 | * Looking up our own fqdn |
253 | */ | 214 | */ |
254 | own_fqdn = GNUNET_RESOLVER_local_fqdn_get (); | 215 | own_fqdn = GNUNET_RESOLVER_local_fqdn_get (); |
255 | check_local_fqdn (NULL, own_fqdn); | 216 | /* can't really check, only thing we can safely |
217 | compare against is our own identical logic... */ | ||
256 | GNUNET_free_non_null (own_fqdn); | 218 | GNUNET_free_non_null (own_fqdn); |
257 | 219 | ||
258 | /* | 220 | /* |