#include <netinet/in.h> /* For IPv6 macros */
+#include <netinet/ip.h> /* For IPTOS macros */
+
#ifdef HAVE_SYS_BITYPES_H
# include <sys/bitypes.h> /* For u_intXX_t */
#endif
# define SHUT_RDWR SHUT_RDWR
#endif
+#ifndef IPTOS_LOWDELAY
+# define IPTOS_LOWDELAY 0x10
+# define IPTOS_THROUGHPUT 0x08
+# define IPTOS_RELIABILITY 0x04
+# define IPTOS_LOWCOST 0x02
+# define IPTOS_MINCOST IPTOS_LOWCOST
+#endif /* IPTOS_LOWDELAY */
+
/* Types */
/* If sys/types.h does not supply intXX_t, supply them ourselves */
# include <ssl/sha.h>
#endif
-RCSID("$Id: entropy.c,v 1.3 2000/04/04 05:04:10 damien Exp $");
+RCSID("$Id: entropy.c,v 1.4 2000/04/08 07:48:56 damien Exp $");
#ifdef EGD_SOCKET
#ifndef offsetof
{ 0.000, NULL, { NULL, NULL, NULL, NULL, NULL } },
};
-
double
stir_from_system(void)
{
do {
next = ai->ai_next;
free(ai);
- } while (ai = next);
+ } while (NULL != (ai = next));
}
#endif /* !HAVE_FREEADDRINFO */
{
struct addrinfo *ai;
- if (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) +
- sizeof(struct sockaddr_in))) {
+ if (NULL != (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) +
+ sizeof(struct sockaddr_in)))) {
memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
ai->ai_addr = (struct sockaddr *)(ai + 1);
/* XXX -- ssh doesn't use sa_len */
else
port = 0;
if (hints && hints->ai_flags & AI_PASSIVE)
- if (*res = malloc_ai(port, htonl(0x00000000)))
+ if (NULL != (*res = malloc_ai(port, htonl(0x00000000))))
return 0;
else
return EAI_MEMORY;
if (!hostname)
- if (*res = malloc_ai(port, htonl(0x7f000001)))
+ if (NULL != (*res = malloc_ai(port, htonl(0x7f000001))))
return 0;
else
return EAI_MEMORY;
if (inet_addr(hostname) != -1)
- if (*res = malloc_ai(port, inet_addr(hostname)))
+ if (NULL != (*res = malloc_ai(port, inet_addr(hostname))))
return 0;
else
return EAI_MEMORY;
if ((hp = gethostbyname(hostname)) &&
hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
for (i = 0; hp->h_addr_list[i]; i++)
- if (cur = malloc_ai(port,
- ((struct in_addr *)hp->h_addr_list[i])->s_addr)) {
+ if (NULL != (cur = malloc_ai(port,
+ ((struct in_addr *)hp->h_addr_list[i])->s_addr))) {
if (prev)
prev->ai_next = cur;
else
return 0;
}
else
- if (hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr),
- AF_INET))
+ if (NULL != (hp = gethostbyaddr((char *)&sin->sin_addr,
+ sizeof(struct in_addr), AF_INET)))
if (strlen(hp->h_name) > hostlen)
return EAI_MEMORY;
else {