[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r9136 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r9136 - gnunet/src/util |
Date: |
Thu, 8 Oct 2009 03:56:40 -0600 |
Author: grothoff
Date: 2009-10-08 03:56:40 -0600 (Thu, 08 Oct 2009)
New Revision: 9136
Modified:
gnunet/src/util/resolver_api.c
Log:
fix code for certain types of /etc/hosts files
Modified: gnunet/src/util/resolver_api.c
===================================================================
--- gnunet/src/util/resolver_api.c 2009-10-08 08:52:48 UTC (rev 9135)
+++ gnunet/src/util/resolver_api.c 2009-10-08 09:56:40 UTC (rev 9136)
@@ -311,7 +311,7 @@
v6.sin6_len = sizeof(v6);
#endif
/* first, check if this is a numeric address */
- if ( ( (domain == AF_UNSPEC) ||(domain == AF_INET) ) &&
+ if ( ( (domain == AF_UNSPEC) || (domain == AF_INET) ) &&
(0 == inet_pton (AF_INET,
hostname,
&v4.sin_addr)) )
@@ -319,7 +319,17 @@
callback (callback_cls,
(const struct sockaddr*) &v4,
sizeof(v4));
- callback (callback_cls, NULL, 0);
+ if ( (domain == AF_UNSPEC) &&
+ (0 == inet_pton (AF_INET6,
+ hostname,
+ &v6.sin6_addr)) )
+ {
+ /* this can happen on some systems IF "hostname" is "localhost" */
+ callback (callback_cls,
+ (const struct sockaddr*) &v6,
+ sizeof(v6));
+ }
+ callback (callback_cls, NULL, 0);
return;
}
if ( ( (domain == AF_UNSPEC) ||(domain == AF_INET) ) &&
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r9136 - gnunet/src/util,
gnunet <=