summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-08 17:48:56 +1000
committerDamien Miller <djm@mindrot.org>2000-04-08 17:48:56 +1000
commitbc7c7cceea205733e3d0902bc751009b5836ff9c (patch)
tree879d315a66bc070c2410ee9da19b93780be517d1
parent73a26627f255088b55172f7947c8c2419634059b (diff)
- Avoid some compiler warnings in fake-get*.c
- Add IPTOS macros for systems which lack them
-rw-r--r--ChangeLog4
-rw-r--r--defines.h10
-rw-r--r--entropy.c3
-rw-r--r--fake-getaddrinfo.c16
-rw-r--r--fake-getnameinfo.c4
5 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 05d37dc4..39284fdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20000408
+ - Avoid some compiler warnings in fake-get*.c
+ - Add IPTOS macros for systems which lack them
+
20000406
- OpenBSD CVS update:
- [channels.c]
diff --git a/defines.h b/defines.h
index b22d703f..f8a23b88 100644
--- a/defines.h
+++ b/defines.h
@@ -9,6 +9,8 @@
#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
@@ -55,6 +57,14 @@ enum
# 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 */
diff --git a/entropy.c b/entropy.c
index 94e7dcec..f304e21c 100644
--- a/entropy.c
+++ b/entropy.c
@@ -41,7 +41,7 @@
# 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
@@ -198,7 +198,6 @@ entropy_source_t entropy_sources[] = {
{ 0.000, NULL, { NULL, NULL, NULL, NULL, NULL } },
};
-
double
stir_from_system(void)
{
diff --git a/fake-getaddrinfo.c b/fake-getaddrinfo.c
index b918798c..456c41e5 100644
--- a/fake-getaddrinfo.c
+++ b/fake-getaddrinfo.c
@@ -41,7 +41,7 @@ struct addrinfo *ai;
do {
next = ai->ai_next;
free(ai);
- } while (ai = next);
+ } while (NULL != (ai = next));
}
#endif /* !HAVE_FREEADDRINFO */
@@ -53,8 +53,8 @@ u_long addr;
{
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 */
@@ -83,25 +83,25 @@ struct addrinfo **res;
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
diff --git a/fake-getnameinfo.c b/fake-getnameinfo.c
index bf1184e2..f74f3128 100644
--- a/fake-getnameinfo.c
+++ b/fake-getnameinfo.c
@@ -46,8 +46,8 @@ int flags;
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 {