]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- Avoid some compiler warnings in fake-get*.c
authorDamien Miller <djm@mindrot.org>
Sat, 8 Apr 2000 07:48:56 +0000 (17:48 +1000)
committerDamien Miller <djm@mindrot.org>
Sat, 8 Apr 2000 07:48:56 +0000 (17:48 +1000)
 - Add IPTOS macros for systems which lack them

ChangeLog
defines.h
entropy.c
fake-getaddrinfo.c
fake-getnameinfo.c

index 05d37dc4a8e9ea079daf13f0e0435d0e5415a462..39284fdb37ef72b788e9503d471956e446512950 100644 (file)
--- 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]
index b22d703f5f444016fe214914d15daa70a670de8e..f8a23b88d77936b1f267d0ae9197622f5f862db0 100644 (file)
--- 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 */
index 94e7dcec1a0ea5007f838314c302e0c43aaf839f..f304e21c1e5701f0ed1452b11b6d87fd053cb171 100644 (file)
--- 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)
 {
index b918798c45e1bd6c496bf5d802542b6059a39a54..456c41e5831231a8f7ae57b4805fdccf4e881d82 100644 (file)
@@ -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
index bf1184e24bc9f9bdb4267a8467d2cbbbf1062a39..f74f3128f725cacd57e2725f9cee3ede8c70fa09 100644 (file)
@@ -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 {