]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix up NetBSD/alpha build.
authorTed Lemon <source@isc.org>
Mon, 26 Feb 2001 22:21:15 +0000 (22:21 +0000)
committerTed Lemon <source@isc.org>
Mon, 26 Feb 2001 22:21:15 +0000 (22:21 +0000)
13 files changed:
Makefile.conf
client/clparse.c
client/dhclient.c
common/bpf.c
common/comapi.c
common/ctrace.c
common/icmp.c
common/packet.c
common/tree.c
configure
omapip/trace.c
relay/dhcrelay.c
server/omapi.c

index b67c788c16309cadfb9652207810dbe876206062..06bd1175f88edea2590fae6864c80609ef2852ed 100644 (file)
@@ -209,11 +209,12 @@ MINORVERSION=MinorVersion
 ##MKDEP=makedepend
 ##--netbsd--
 
-## NetBSD Arm32
-## The arm32 gcc currently has a bug in the conversion warning code.   :'(
-## Don't consider this to be true when you read this - it's probably
-## not permanent...
-##--netbsd-arm32--
+## NetBSD nocast
+## Some versions of the arm32 gcc have a problem in cast conversions.
+## The Alpha definitely has a problem - if you pass '6' where a size_t
+## is expected, you get a warning.   So on these architectures, we do
+## not ask for that sort of warning.
+##--netbsd-nocast--
 #CF = cf/netbsd.h
 #COPTS  = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \
 #        -Wno-uninitialized -Werror \
@@ -222,7 +223,7 @@ MINORVERSION=MinorVersion
 #        -Wmissing-declarations -Wnested-externs \
 #        -pipe $(BINDDEF)
 #SCRIPT=netbsd
-##--netbsd-arm32--
+##--netbsd-nocast--
 
 ## Ultrix
 ##--ultrix--
index cc0c6e7321e7d30ecb4ff1118a507ce08dd6ff26..8f54209cc2ab93b35784cea05bf5877cf80fce27 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: clparse.c,v 1.55 2001/02/12 19:37:03 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: clparse.c,v 1.56 2001/02/26 22:21:02 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -576,7 +576,7 @@ void parse_option_list (cfile, list)
                r = new_pair (MDL);
                if (!r)
                        log_fatal ("can't allocate pair for option code.");
-               r -> car = (caddr_t)i;
+               r -> car = (caddr_t)(long)i;
                r -> cdr = (pair)0;
                if (p)
                        q -> cdr = r;
@@ -601,7 +601,7 @@ void parse_option_list (cfile, list)
                else {
                        ix = 0;
                        for (q = p; q; q = q -> cdr)
-                               (*list) [ix++] = (u_int32_t)q -> car;
+                               (*list) [ix++] = (u_int32_t)(long)q -> car;
                        (*list) [ix] = 0;
                }
                while (p) {
index 4898da07972392fed0b4f5ab1ab757ff392c0438..0f9923759c5b48d8581565938d090292397b81bc 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.121 2001/02/15 22:17:05 neild Exp $ Copyright (c) 1995-2001 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.122 2001/02/26 22:21:04 mellon Exp $ Copyright (c) 1995-2001 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -201,8 +201,8 @@ int main (argc, argv, envp)
                        log_fatal ("Can't record interface %s:%s",
                                   argv [i], isc_result_totext (status));
                    if (strlen (argv [i]) > sizeof tmp -> name)
-                           log_fatal ("%s: interface name too long (max %d)",
-                                      argv [i], strlen (argv [i]));
+                           log_fatal ("%s: interface name too long (max %ld)",
+                                      argv [i], (long)strlen (argv [i]));
                    strcpy (tmp -> name, argv [i]);
                    if (interfaces) {
                            interface_reference (&tmp -> next,
@@ -1352,7 +1352,7 @@ void send_discover (cpp)
        log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
              client -> name ? client -> name : client -> interface -> name,
              inet_ntoa (sockaddr_broadcast.sin_addr),
-             ntohs (sockaddr_broadcast.sin_port), client -> interval);
+             ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval));
 
        /* Send out a packet. */
        result = send_packet (client -> interface, (struct packet *)0,
index 3a65ffa398ad66b1be038aae229a2ecc82531f01..c7809f250e3c62e1b0b985af603d9d1ff9649649 100644 (file)
@@ -47,7 +47,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: bpf.c,v 1.45 2000/12/28 23:13:07 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: bpf.c,v 1.46 2001/02/26 22:21:05 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -282,8 +282,8 @@ void if_register_receive (info)
                log_fatal ("Can't get bpf buffer length: %m");
        info -> rbuf = dmalloc (info -> rbuf_max, MDL);
        if (!info -> rbuf)
-               log_fatal ("Can't allocate %d bytes for bpf input buffer.",
-                          info -> rbuf_max);
+               log_fatal ("Can't allocate %ld bytes for bpf input buffer.",
+                          (long)(info -> rbuf_max));
        info -> rbuf_offset = 0;
        info -> rbuf_len = 0;
 
index 405769ba3b69548376fbb921402393e32568380c..1e5e98a10262d26ce9811224ffd22e70c3fe1abf 100644 (file)
@@ -50,7 +50,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: comapi.c,v 1.7 2000/12/28 23:14:05 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: comapi.c,v 1.8 2001/02/26 22:21:06 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -267,7 +267,7 @@ isc_result_t dhcp_group_signal_handler (omapi_object_t *h,
                if (!group -> name) {
                        char hnbuf [64];
                        sprintf (hnbuf, "ng%08lx%08lx",
-                                cur_time, (unsigned long)group);
+                                (unsigned long)cur_time, (unsigned long)group);
                        group -> name = dmalloc (strlen (hnbuf) + 1, MDL);
                        if (!group -> name)
                                return ISC_R_NOMEMORY;
index 60988a64ce63e99a81ea55d9f0b28194a8162c13..bea933cb433cf580c791507c6490b16007376dd4 100644 (file)
@@ -68,8 +68,8 @@ void trace_interface_input (trace_type_t *ttype, unsigned len, char *buf)
        isc_result_t status;
 
        if (len != sizeof *tipkt) {
-               log_error ("trace interface packet size mismatch: %d != %d",
-                          sizeof *tipkt, len);
+               log_error ("trace interface packet size mismatch: %ld != %d",
+                          (long)(sizeof *tipkt), len);
                return;
        }
        tipkt = (trace_interface_packet_t *)buf;
index a5811c5d72ffbbde4e3162b14f483f05bd738fdf..d1376f7a0d122e93c541b0b3d584a7229f8e4c36 100644 (file)
@@ -44,7 +44,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: icmp.c,v 1.27 2001/02/17 21:34:50 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: icmp.c,v 1.28 2001/02/26 22:21:08 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -311,7 +311,7 @@ void trace_icmp_output_input (trace_type_t *ttype, unsigned length, char *buf)
 
        if (length != (sizeof (*icmp) + (sizeof *ia))) {
                log_error ("trace_icmp_output_input: data size mismatch %d:%d",
-                          length, (sizeof (*icmp) + (sizeof *ia)));
+                          length, (int)((sizeof (*icmp)) + (sizeof *ia)));
                return;
        }
        ia = (struct iaddr *)buf;
index a34aae19f8ee0556798723e170457a1bc495c250..cafe26e3045c1fda0b8d670d787a1d450b321837 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: packet.c,v 1.39 2000/10/15 18:54:29 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: packet.c,v 1.40 2001/02/26 22:21:10 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -305,8 +305,8 @@ ssize_t decode_udp_ip_header (interface, buf, bufix, from, data, buflen)
          if (len + data < buf + bufix + buflen)
                  log_debug ("accepting packet with data after udp payload.");
          if (len + data > buf + bufix + buflen) {
-                 log_debug ("dropping packet with bogus uh_ulen %d",
-                            len + sizeof *udp);
+                 log_debug ("dropping packet with bogus uh_ulen %ld",
+                            (long)(len + sizeof *udp));
                  return -1;
          }
   }
index 25b2abe24c2611f843224a6868b5c41e82d8b8a0..f0464fe049c77715920c6b33c6dac9e900f5b460 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: tree.c,v 1.98 2001/01/25 08:24:33 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: tree.c,v 1.99 2001/02/26 22:21:11 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -2220,7 +2220,7 @@ int evaluate_numeric_expression (result, packet, lease, client_state,
                if (lease -> ends < cur_time) {
                        log_error ("%s %lu when it is now %lu",
                                   "data: lease_time: lease ends at",
-                                  lease -> ends, cur_time);
+                                  (long)(lease -> ends), (long)cur_time);
                        return 0;
                }
                *result = lease -> ends - cur_time;
index d6c82e1e467d9f7f3fdaa09c9da9f0f202233b67..ab08a3b094da86004ab81700bb381a46d0a0f22a 100755 (executable)
--- a/configure
+++ b/configure
@@ -83,7 +83,8 @@ if [ "$sysname" = "" ]; then
     NetBSD)
       hw=`uname -m`
       case $hw in
-       arm32) sysname=netbsd-arm32;;
+       arm32) sysname=netbsd-nocast;;
+       alpha) sysname=netbsd-nocast;;
        *) sysname=netbsd;;
       esac;;
     OpenBSD)
index 8cfd49bee6a1c94cc98c079c5bf066590ca323a4..2891b5564b22047bf2e707dc633505e2d167fefe 100644 (file)
@@ -130,8 +130,8 @@ isc_result_t trace_begin (const char *filename,
                log_error ("%s(%d): trace_begin write failed: %m", file, line);
                return ISC_R_UNEXPECTED;
        } else if (status != sizeof tfh) {
-               log_error ("%s(%d): trace_begin: short write (%d:%d)",
-                          file, line, status, sizeof tfh);
+               log_error ("%s(%d): trace_begin: short write (%d:%ld)",
+                          file, line, status, (long)(sizeof tfh));
                trace_stop ();
                return ISC_R_UNEXPECTED;
        }
@@ -207,8 +207,8 @@ isc_result_t trace_write_packet_iov (trace_type_t *ttype,
                           file, line);
                return ISC_R_UNEXPECTED;
        } else if (status != sizeof tmp) {
-               log_error ("%s(%d): trace_write_packet: short write (%d:%d)",
-                          file, line, status, sizeof tmp);
+               log_error ("%s(%d): trace_write_packet: short write (%d:%ld)",
+                          file, line, status, (long)(sizeof tmp));
                trace_stop ();
        }
 
@@ -408,8 +408,8 @@ void trace_file_replay (const char *filename)
                if (ferror (traceinfile))
                        log_error ("Error reading trace file header: %m");
                else
-                       log_error ("Short read on trace file header: %d %d.",
-                                  status, sizeof tracefile_header);
+                       log_error ("Short read on trace file header: %d %ld.",
+                                  status, (long)(sizeof tracefile_header));
                goto out;
        }
        tracefile_header.magic = ntohl (tracefile_header.magic);
index b07874e37d3cb81905b72ee9a7ae7b963a98dc2e..daadec68a5ecb134194b3d9a73c5c2e2d6563755 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcrelay.c,v 1.49 2001/02/12 20:50:31 mellon Exp $ Copyright (c) 1997-2000 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcrelay.c,v 1.50 2001/02/26 22:21:14 mellon Exp $ Copyright (c) 1997-2000 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -819,8 +819,8 @@ int add_relay_agent_options (ip, packet, length, giaddr)
        /* Relay option's total length shouldn't ever get to be more than
           257 bytes. */
        if (sp - op > 257)
-               log_fatal ("total agent option length exceeds 257 (%d) on %s\n",
-                      sp - op, ip -> name);
+           log_fatal ("total agent option length exceeds 257 (%ld) on %s\n",
+                      (long)(sp - op), ip -> name);
 
        /* Calculate length of RAI option. */
        op [1] = sp - op - 2;
index 30884447fc1dda5e04757b12f8194faa95d7b826..6fe0fc98974f8010ad29b8fe1ab43fe166722370 100644 (file)
@@ -50,7 +50,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: omapi.c,v 1.42 2001/02/12 21:10:10 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: omapi.c,v 1.43 2001/02/26 22:21:15 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1004,7 +1004,7 @@ isc_result_t dhcp_host_signal_handler (omapi_object_t *h,
                if (!host -> name) {
                        char hnbuf [64];
                        sprintf (hnbuf, "nh%08lx%08lx",
-                                cur_time, (unsigned long)host);
+                                (unsigned long)cur_time, (unsigned long)host);
                        host -> name = dmalloc (strlen (hnbuf) + 1, MDL);
                        if (!host -> name)
                                return ISC_R_NOMEMORY;