/*
This file is part of GNUnet.
- Copyright (C) 2007-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2007-2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
{
pos = GNUNET_malloc (sizeof (struct IPCache) + ip_len);
pos->ip = &pos[1];
- memcpy (&pos[1], ip, ip_len);
+ GNUNET_memcpy (&pos[1], ip, ip_len);
pos->last_request = now;
pos->last_refresh = now;
pos->ip_len = ip_len;
freeaddrinfo (result);
return GNUNET_OK;
}
-#endif
-#if HAVE_GETHOSTBYNAME2
+#elif HAVE_GETHOSTBYNAME2
+
+
static int
gethostbyname2_resolve (struct GNUNET_SERVER_TransmitContext *tc,
const char *hostname,
}
return GNUNET_OK;
}
-#endif
+
+#elif HAVE_GETHOSTBYNAME
-#if HAVE_GETHOSTBYNAME
static int
gethostbyname_resolve (struct GNUNET_SERVER_TransmitContext *tc,
const char *hostname)
#if HAVE_GETADDRINFO
if (ret == GNUNET_NO)
ret = getaddrinfo_resolve (tc, hostname, af);
-#endif
-#if HAVE_GETHOSTBYNAME2
+#elif HAVE_GETHOSTBYNAME2
if (ret == GNUNET_NO)
ret = gethostbyname2_resolve (tc, hostname, af);
-#endif
-#if HAVE_GETHOSTBYNAME
+#elif HAVE_GETHOSTBYNAME
if ((ret == GNUNET_NO) && ((af == AF_UNSPEC) || (af == PF_INET)))
gethostbyname_resolve (tc, hostname);
#endif
return ret;
}
-#ifdef LINUX
+#if defined(LINUX) && defined(__GLIBC__)
#include <malloc.h>
/**