2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-22 18:07:25 +00:00

Fix up NetBSD/alpha build.

This commit is contained in:
Ted Lemon 2001-02-26 22:21:15 +00:00
parent a1ec58f608
commit c466184540
13 changed files with 41 additions and 39 deletions

View File

@ -209,11 +209,12 @@ MINORVERSION=MinorVersion
##MKDEP=makedepend ##MKDEP=makedepend
##--netbsd-- ##--netbsd--
## NetBSD Arm32 ## NetBSD nocast
## The arm32 gcc currently has a bug in the conversion warning code. :'( ## Some versions of the arm32 gcc have a problem in cast conversions.
## Don't consider this to be true when you read this - it's probably ## The Alpha definitely has a problem - if you pass '6' where a size_t
## not permanent... ## is expected, you get a warning. So on these architectures, we do
##--netbsd-arm32-- ## not ask for that sort of warning.
##--netbsd-nocast--
#CF = cf/netbsd.h #CF = cf/netbsd.h
#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \ #COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \
# -Wno-uninitialized -Werror \ # -Wno-uninitialized -Werror \
@ -222,7 +223,7 @@ MINORVERSION=MinorVersion
# -Wmissing-declarations -Wnested-externs \ # -Wmissing-declarations -Wnested-externs \
# -pipe $(BINDDEF) # -pipe $(BINDDEF)
#SCRIPT=netbsd #SCRIPT=netbsd
##--netbsd-arm32-- ##--netbsd-nocast--
## Ultrix ## Ultrix
##--ultrix-- ##--ultrix--

View File

@ -43,7 +43,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -576,7 +576,7 @@ void parse_option_list (cfile, list)
r = new_pair (MDL); r = new_pair (MDL);
if (!r) if (!r)
log_fatal ("can't allocate pair for option code."); log_fatal ("can't allocate pair for option code.");
r -> car = (caddr_t)i; r -> car = (caddr_t)(long)i;
r -> cdr = (pair)0; r -> cdr = (pair)0;
if (p) if (p)
q -> cdr = r; q -> cdr = r;
@ -601,7 +601,7 @@ void parse_option_list (cfile, list)
else { else {
ix = 0; ix = 0;
for (q = p; q; q = q -> cdr) 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; (*list) [ix] = 0;
} }
while (p) { while (p) {

View File

@ -41,7 +41,7 @@
#ifndef lint #ifndef lint
static char ocopyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -201,8 +201,8 @@ int main (argc, argv, envp)
log_fatal ("Can't record interface %s:%s", log_fatal ("Can't record interface %s:%s",
argv [i], isc_result_totext (status)); argv [i], isc_result_totext (status));
if (strlen (argv [i]) > sizeof tmp -> name) if (strlen (argv [i]) > sizeof tmp -> name)
log_fatal ("%s: interface name too long (max %d)", log_fatal ("%s: interface name too long (max %ld)",
argv [i], strlen (argv [i])); argv [i], (long)strlen (argv [i]));
strcpy (tmp -> name, argv [i]); strcpy (tmp -> name, argv [i]);
if (interfaces) { if (interfaces) {
interface_reference (&tmp -> next, interface_reference (&tmp -> next,
@ -1352,7 +1352,7 @@ void send_discover (cpp)
log_info ("DHCPDISCOVER on %s to %s port %d interval %ld", log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
client -> name ? client -> name : client -> interface -> name, client -> name ? client -> name : client -> interface -> name,
inet_ntoa (sockaddr_broadcast.sin_addr), 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. */ /* Send out a packet. */
result = send_packet (client -> interface, (struct packet *)0, result = send_packet (client -> interface, (struct packet *)0,

View File

@ -47,7 +47,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -282,8 +282,8 @@ void if_register_receive (info)
log_fatal ("Can't get bpf buffer length: %m"); log_fatal ("Can't get bpf buffer length: %m");
info -> rbuf = dmalloc (info -> rbuf_max, MDL); info -> rbuf = dmalloc (info -> rbuf_max, MDL);
if (!info -> rbuf) if (!info -> rbuf)
log_fatal ("Can't allocate %d bytes for bpf input buffer.", log_fatal ("Can't allocate %ld bytes for bpf input buffer.",
info -> rbuf_max); (long)(info -> rbuf_max));
info -> rbuf_offset = 0; info -> rbuf_offset = 0;
info -> rbuf_len = 0; info -> rbuf_len = 0;

View File

@ -50,7 +50,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -267,7 +267,7 @@ isc_result_t dhcp_group_signal_handler (omapi_object_t *h,
if (!group -> name) { if (!group -> name) {
char hnbuf [64]; char hnbuf [64];
sprintf (hnbuf, "ng%08lx%08lx", sprintf (hnbuf, "ng%08lx%08lx",
cur_time, (unsigned long)group); (unsigned long)cur_time, (unsigned long)group);
group -> name = dmalloc (strlen (hnbuf) + 1, MDL); group -> name = dmalloc (strlen (hnbuf) + 1, MDL);
if (!group -> name) if (!group -> name)
return ISC_R_NOMEMORY; return ISC_R_NOMEMORY;

View File

@ -68,8 +68,8 @@ void trace_interface_input (trace_type_t *ttype, unsigned len, char *buf)
isc_result_t status; isc_result_t status;
if (len != sizeof *tipkt) { if (len != sizeof *tipkt) {
log_error ("trace interface packet size mismatch: %d != %d", log_error ("trace interface packet size mismatch: %ld != %d",
sizeof *tipkt, len); (long)(sizeof *tipkt), len);
return; return;
} }
tipkt = (trace_interface_packet_t *)buf; tipkt = (trace_interface_packet_t *)buf;

View File

@ -44,7 +44,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #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))) { if (length != (sizeof (*icmp) + (sizeof *ia))) {
log_error ("trace_icmp_output_input: data size mismatch %d:%d", log_error ("trace_icmp_output_input: data size mismatch %d:%d",
length, (sizeof (*icmp) + (sizeof *ia))); length, (int)((sizeof (*icmp)) + (sizeof *ia)));
return; return;
} }
ia = (struct iaddr *)buf; ia = (struct iaddr *)buf;

View File

@ -42,7 +42,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #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) if (len + data < buf + bufix + buflen)
log_debug ("accepting packet with data after udp payload."); log_debug ("accepting packet with data after udp payload.");
if (len + data > buf + bufix + buflen) { if (len + data > buf + bufix + buflen) {
log_debug ("dropping packet with bogus uh_ulen %d", log_debug ("dropping packet with bogus uh_ulen %ld",
len + sizeof *udp); (long)(len + sizeof *udp));
return -1; return -1;
} }
} }

View File

@ -43,7 +43,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -2220,7 +2220,7 @@ int evaluate_numeric_expression (result, packet, lease, client_state,
if (lease -> ends < cur_time) { if (lease -> ends < cur_time) {
log_error ("%s %lu when it is now %lu", log_error ("%s %lu when it is now %lu",
"data: lease_time: lease ends at", "data: lease_time: lease ends at",
lease -> ends, cur_time); (long)(lease -> ends), (long)cur_time);
return 0; return 0;
} }
*result = lease -> ends - cur_time; *result = lease -> ends - cur_time;

3
configure vendored
View File

@ -83,7 +83,8 @@ if [ "$sysname" = "" ]; then
NetBSD) NetBSD)
hw=`uname -m` hw=`uname -m`
case $hw in case $hw in
arm32) sysname=netbsd-arm32;; arm32) sysname=netbsd-nocast;;
alpha) sysname=netbsd-nocast;;
*) sysname=netbsd;; *) sysname=netbsd;;
esac;; esac;;
OpenBSD) OpenBSD)

View File

@ -130,8 +130,8 @@ isc_result_t trace_begin (const char *filename,
log_error ("%s(%d): trace_begin write failed: %m", file, line); log_error ("%s(%d): trace_begin write failed: %m", file, line);
return ISC_R_UNEXPECTED; return ISC_R_UNEXPECTED;
} else if (status != sizeof tfh) { } else if (status != sizeof tfh) {
log_error ("%s(%d): trace_begin: short write (%d:%d)", log_error ("%s(%d): trace_begin: short write (%d:%ld)",
file, line, status, sizeof tfh); file, line, status, (long)(sizeof tfh));
trace_stop (); trace_stop ();
return ISC_R_UNEXPECTED; return ISC_R_UNEXPECTED;
} }
@ -207,8 +207,8 @@ isc_result_t trace_write_packet_iov (trace_type_t *ttype,
file, line); file, line);
return ISC_R_UNEXPECTED; return ISC_R_UNEXPECTED;
} else if (status != sizeof tmp) { } else if (status != sizeof tmp) {
log_error ("%s(%d): trace_write_packet: short write (%d:%d)", log_error ("%s(%d): trace_write_packet: short write (%d:%ld)",
file, line, status, sizeof tmp); file, line, status, (long)(sizeof tmp));
trace_stop (); trace_stop ();
} }
@ -408,8 +408,8 @@ void trace_file_replay (const char *filename)
if (ferror (traceinfile)) if (ferror (traceinfile))
log_error ("Error reading trace file header: %m"); log_error ("Error reading trace file header: %m");
else else
log_error ("Short read on trace file header: %d %d.", log_error ("Short read on trace file header: %d %ld.",
status, sizeof tracefile_header); status, (long)(sizeof tracefile_header));
goto out; goto out;
} }
tracefile_header.magic = ntohl (tracefile_header.magic); tracefile_header.magic = ntohl (tracefile_header.magic);

View File

@ -43,7 +43,7 @@
#ifndef lint #ifndef lint
static char ocopyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #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 /* Relay option's total length shouldn't ever get to be more than
257 bytes. */ 257 bytes. */
if (sp - op > 257) if (sp - op > 257)
log_fatal ("total agent option length exceeds 257 (%d) on %s\n", log_fatal ("total agent option length exceeds 257 (%ld) on %s\n",
sp - op, ip -> name); (long)(sp - op), ip -> name);
/* Calculate length of RAI option. */ /* Calculate length of RAI option. */
op [1] = sp - op - 2; op [1] = sp - op - 2;

View File

@ -50,7 +50,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -1004,7 +1004,7 @@ isc_result_t dhcp_host_signal_handler (omapi_object_t *h,
if (!host -> name) { if (!host -> name) {
char hnbuf [64]; char hnbuf [64];
sprintf (hnbuf, "nh%08lx%08lx", sprintf (hnbuf, "nh%08lx%08lx",
cur_time, (unsigned long)host); (unsigned long)cur_time, (unsigned long)host);
host -> name = dmalloc (strlen (hnbuf) + 1, MDL); host -> name = dmalloc (strlen (hnbuf) + 1, MDL);
if (!host -> name) if (!host -> name)
return ISC_R_NOMEMORY; return ISC_R_NOMEMORY;