From: Ted Lemon Date: Thu, 25 Jun 1998 21:11:35 +0000 (+0000) Subject: Fix inconsistencies between signed and unsigned character declarations. Account... X-Git-Tag: V2-BETA-1-PATCH-2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4cde1c6660d5bf985d5b5db34b1450c4d281d16;p=thirdparty%2Fdhcp.git Fix inconsistencies between signed and unsigned character declarations. Account for promotion in prototypes. --- diff --git a/client/clparse.c b/client/clparse.c index 74f72e556..37fafd378 100644 --- a/client/clparse.c +++ b/client/clparse.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: clparse.c,v 1.13 1997/10/27 20:13:21 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; +"$Id: clparse.c,v 1.13.2.1 1998/06/25 21:11:27 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -771,8 +771,9 @@ struct option *parse_option_decl (cfile, options) /* Look up the option name hash table for the specified vendor. */ - universe = (struct universe *)hash_lookup (&universe_hash, - vendor, 0); + universe = ((struct universe *) + hash_lookup (&universe_hash, + (unsigned char *)vendor, 0)); /* If it's not there, we can't parse the rest of the declaration. */ if (!universe) { @@ -788,7 +789,8 @@ struct option *parse_option_decl (cfile, options) } /* Look up the actual option info... */ - option = (struct option *)hash_lookup (universe -> hash, val, 0); + option = (struct option *)hash_lookup (universe -> hash, + (unsigned char *)val, 0); /* If we didn't get an option structure, it's an undefined option. */ if (!option) { diff --git a/common/convert.c b/common/convert.c index 9b5fcd7a2..42f488b30 100644 --- a/common/convert.c +++ b/common/convert.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: convert.c,v 1.4 1997/05/09 07:58:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: convert.c,v 1.4.2.1 1998/06/25 21:11:28 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -102,7 +102,7 @@ void putLong (obuf, val) void putUShort (obuf, val) unsigned char *obuf; - u_int16_t val; + unsigned int val; { u_int16_t tmp = htons (val); memcpy (obuf, &tmp, sizeof tmp); @@ -110,7 +110,7 @@ void putUShort (obuf, val) void putShort (obuf, val) unsigned char *obuf; - int16_t val; + int val; { int16_t tmp = htons (val); memcpy (obuf, &tmp, sizeof tmp); diff --git a/common/dispatch.c b/common/dispatch.c index e3f651e89..92fd579b7 100644 --- a/common/dispatch.c +++ b/common/dispatch.c @@ -3,7 +3,7 @@ Network input dispatcher... */ /* - * Copyright (c) 1995, 1996 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: dispatch.c,v 1.47.2.1 1998/06/25 05:45:10 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dispatch.c,v 1.47.2.2 1998/06/25 21:11:28 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -54,7 +54,7 @@ struct timeout *timeouts; static struct timeout *free_timeouts; static int interfaces_invalidated; void (*bootp_packet_handler) PROTO ((struct interface_info *, - struct dhcp_packet *, int, unsigned short, + struct dhcp_packet *, int, unsigned int, struct iaddr, struct hardware *)); static void got_one PROTO ((struct protocol *)); diff --git a/common/hash.c b/common/hash.c index e8e937520..8d362cb12 100644 --- a/common/hash.c +++ b/common/hash.c @@ -3,7 +3,7 @@ Routines for manipulating hash tables... */ /* - * Copyright (c) 1995, 1996 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,12 +42,12 @@ #ifndef lint static char copyright[] = -"$Id: hash.c,v 1.9 1996/09/09 07:04:45 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: hash.c,v 1.9.2.1 1998/06/25 21:11:29 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" -static INLINE int do_hash PROTO ((char *, int, int)); +static INLINE int do_hash PROTO ((unsigned char *, int, int)); struct hash_table *new_hash () { @@ -60,12 +60,12 @@ struct hash_table *new_hash () } static INLINE int do_hash (name, len, size) - char *name; + unsigned char *name; int len; int size; { register int accum = 0; - register unsigned char *s = (unsigned char *)name; + register unsigned char *s = name; int i = len; if (i) { while (i--) { @@ -92,7 +92,7 @@ static INLINE int do_hash (name, len, size) void add_hash (table, name, len, pointer) struct hash_table *table; int len; - char *name; + unsigned char *name; unsigned char *pointer; { int hashno; @@ -118,7 +118,7 @@ void add_hash (table, name, len, pointer) void delete_hash_entry (table, name, len) struct hash_table *table; int len; - char *name; + unsigned char *name; { int hashno; struct hash_bucket *bp, *pbp = (struct hash_bucket *)0; @@ -131,7 +131,8 @@ void delete_hash_entry (table, name, len) /* Go through the list looking for an entry that matches; if we find it, delete it. */ for (bp = table -> buckets [hashno]; bp; bp = bp -> next) { - if ((!bp -> len && !strcmp (bp -> name, name)) || + if ((!bp -> len && + !strcmp ((char *)bp -> name, (char *)name)) || (bp -> len == len && !memcmp (bp -> name, name, len))) { if (pbp) { @@ -148,7 +149,7 @@ void delete_hash_entry (table, name, len) unsigned char *hash_lookup (table, name, len) struct hash_table *table; - char *name; + unsigned char *name; int len; { int hashno; @@ -166,7 +167,7 @@ unsigned char *hash_lookup (table, name, len) } } else { for (bp = table -> buckets [hashno]; bp; bp = bp -> next) - if (!strcmp (bp -> name, name)) + if (!strcmp ((char *)bp -> name, (char *)name)) return bp -> value; } return (unsigned char *)0; diff --git a/common/icmp.c b/common/icmp.c index 590828426..fb6cfad97 100644 --- a/common/icmp.c +++ b/common/icmp.c @@ -1,10 +1,10 @@ -/* dhcp.c +/* icmp.c ICMP Protocol engine - for sending out pings and receiving responses. */ /* - * Copyright (c) 1997 The Internet Software Consortium. + * Copyright (c) 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: icmp.c,v 1.7 1997/06/04 20:59:40 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; +"$Id: icmp.c,v 1.7.2.1 1998/06/25 21:11:29 mellon Exp $ Copyright (c) 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -86,7 +86,8 @@ void icmp_startup (routep, handler) (char *)&state, sizeof state) < 0) error ("Unable to disable SO_DONTROUTE on ICMP socket: %m"); - add_protocol ("icmp", icmp_protocol_fd, icmp_echoreply, handler); + add_protocol ("icmp", icmp_protocol_fd, icmp_echoreply, + (void *)handler); } int icmp_echorequest (addr) @@ -136,14 +137,14 @@ void icmp_echoreply (protocol) { struct icmp *icfrom; struct sockaddr_in from; - unsigned char icbuf [1500]; + u_int8_t icbuf [1500]; int status; int len; struct iaddr ia; void (*handler) PROTO ((struct iaddr, u_int8_t *, int)); len = sizeof from; - status = recvfrom (protocol -> fd, icbuf, sizeof icbuf, 0, + status = recvfrom (protocol -> fd, (char *)icbuf, sizeof icbuf, 0, (struct sockaddr *)&from, &len); if (status < 0) { warn ("icmp_echoreply: %m"); @@ -165,7 +166,9 @@ void icmp_echoreply (protocol) /* If we were given a second-stage handler, call it. */ if (protocol -> local) { - handler = protocol -> local; + handler = ((void (*) PROTO ((struct iaddr, + u_int8_t *, int))) + protocol -> local); memcpy (ia.iabuf, &from.sin_addr, sizeof from.sin_addr); ia.len = sizeof from.sin_addr; diff --git a/common/memory.c b/common/memory.c index ddb6c4d8e..59cbe5daf 100644 --- a/common/memory.c +++ b/common/memory.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: memory.c,v 1.35.2.1 1998/06/25 05:47:29 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: memory.c,v 1.35.2.2 1998/06/25 21:11:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -838,16 +838,18 @@ struct class *add_class (type, name) if (type) add_hash (user_class_hash, - tname, strlen (tname), (unsigned char *)class); + (unsigned char *)tname, strlen (tname), + (unsigned char *)class); else add_hash (vendor_class_hash, - tname, strlen (tname), (unsigned char *)class); + (unsigned char *)tname, strlen (tname), + (unsigned char *)class); return class; } struct class *find_class (type, name, len) int type; - char *name; + unsigned char *name; int len; { struct class *class = diff --git a/common/options.c b/common/options.c index 601facce3..9d6b7f46a 100644 --- a/common/options.c +++ b/common/options.c @@ -3,7 +3,7 @@ DHCP options parsing and reassembly. */ /* - * Copyright (c) 1995, 1996 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.26.2.2 1998/06/25 05:49:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.26.2.3 1998/06/25 21:11:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA @@ -72,10 +72,12 @@ void parse_options (packet) && packet -> options [DHO_DHCP_OPTION_OVERLOAD].data) { if (packet -> options [DHO_DHCP_OPTION_OVERLOAD].data [0] & 1) parse_option_buffer (packet, + (unsigned char *) packet -> raw -> file, sizeof packet -> raw -> file); if (packet -> options [DHO_DHCP_OPTION_OVERLOAD].data [0] & 2) parse_option_buffer (packet, + (unsigned char *) packet -> raw -> sname, sizeof packet -> raw -> sname); } @@ -516,8 +518,8 @@ char *pretty_print_option (code, data, len, emit_commas, emit_quotes) case 't': if (emit_quotes) *op++ = '"'; - strcpy (op, dp); - op += strlen (dp); + strcpy (op, (char *)dp); + op += strlen ((char *)dp); if (emit_quotes) *op++ = '"'; *op = 0; @@ -575,7 +577,7 @@ void do_packet (interface, packet, len, from_port, from, hfrom) struct interface_info *interface; struct dhcp_packet *packet; int len; - unsigned short from_port; + unsigned int from_port; struct iaddr from; struct hardware *hfrom; { diff --git a/common/parse.c b/common/parse.c index ffc1d49d0..97bfa877b 100644 --- a/common/parse.c +++ b/common/parse.c @@ -3,7 +3,7 @@ Common parser code for dhcpd and dhclient. */ /* - * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.2 1997/05/09 08:08:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.2.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -297,7 +297,8 @@ unsigned char *parse_numeric_aggregate (cfile, buf, { char *val; int token; - unsigned char *bufp = buf, *s, *t; + unsigned char *bufp = buf, *s; + char *t; int count = 0; pair c = (pair)0; @@ -343,7 +344,7 @@ unsigned char *parse_numeric_aggregate (cfile, buf, convert_num (s, val, base, size); s += size / 8; } else { - t = (unsigned char *)malloc (strlen (val) + 1); + t = (char *)malloc (strlen (val) + 1); if (!t) error ("no temp space for number."); strcpy (t, val); diff --git a/common/print.c b/common/print.c index 8b5aefd55..ed51b1584 100644 --- a/common/print.c +++ b/common/print.c @@ -3,7 +3,7 @@ Turn data structures into printable text. */ /* - * Copyright (c) 1995, 1996 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: print.c,v 1.16 1997/11/29 07:52:10 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: print.c,v 1.16.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -178,7 +178,7 @@ void hash_dump (table) if (bp -> len) dump_raw (bp -> name, bp -> len); else - note (bp -> name); + note ((char *)bp -> name); } } } diff --git a/common/socket.c b/common/socket.c index af216d6f5..b317ff2ba 100644 --- a/common/socket.c +++ b/common/socket.c @@ -50,7 +50,7 @@ #ifndef lint static char copyright[] = -"$Id: socket.c,v 1.26.2.1 1998/05/18 05:45:49 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: socket.c,v 1.26.2.2 1998/06/25 21:11:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -224,7 +224,7 @@ ssize_t receive_packet (interface, buf, len, from, hfrom) int retry = 0; do { #endif - result = recvfrom (interface -> rfdesc, buf, len, 0, + result = recvfrom (interface -> rfdesc, (char *)buf, len, 0, (struct sockaddr *)from, &flen); #ifdef IGNORE_HOSTUNREACH } while (result < 0 && diff --git a/common/tables.c b/common/tables.c index 81669c84e..bdbba1b78 100644 --- a/common/tables.c +++ b/common/tables.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: tables.c,v 1.13 1997/05/09 08:13:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: tables.c,v 1.13.2.1 1998/06/25 21:11:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -681,10 +681,12 @@ void initialize_universes() error ("Can't allocate dhcp option hash table."); for (i = 0; i < 256; i++) { dhcp_universe.options [i] = &dhcp_options [i]; - add_hash (dhcp_universe.hash, dhcp_options [i].name, 0, + add_hash (dhcp_universe.hash, + (unsigned char *)dhcp_options [i].name, 0, (unsigned char *)&dhcp_options [i]); } universe_hash.hash_count = DEFAULT_HASH_SIZE; - add_hash (&universe_hash, dhcp_universe.name, 0, + add_hash (&universe_hash, + (unsigned char *)dhcp_universe.name, 0, (unsigned char *)&dhcp_universe); } diff --git a/includes/dhcpd.h b/includes/dhcpd.h index e18367309..84ff419bb 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -3,7 +3,7 @@ Definitions for dhcpd... */ /* - * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -460,7 +460,7 @@ char *pretty_print_option PROTO ((unsigned int, unsigned char *, int, int, int)); void do_packet PROTO ((struct interface_info *, struct dhcp_packet *, int, - unsigned short, struct iaddr, struct hardware *)); + unsigned int, struct iaddr, struct hardware *)); /* errwarn.c */ extern int warnings_occurred; @@ -553,7 +553,7 @@ void dhcprelease PROTO ((struct packet *)); void dhcpdecline PROTO ((struct packet *)); void dhcpinform PROTO ((struct packet *)); void nak_lease PROTO ((struct packet *, struct iaddr *cip)); -void ack_lease PROTO ((struct packet *, struct lease *, unsigned char, TIME)); +void ack_lease PROTO ((struct packet *, struct lease *, unsigned int, TIME)); void dhcp_reply PROTO ((struct lease *)); struct lease *find_lease PROTO ((struct packet *, struct shared_network *, int *)); @@ -590,7 +590,7 @@ void uid_hash_delete PROTO ((struct lease *)); void hw_hash_add PROTO ((struct lease *)); void hw_hash_delete PROTO ((struct lease *)); struct class *add_class PROTO ((int, char *)); -struct class *find_class PROTO ((int, char *, int)); +struct class *find_class PROTO ((int, unsigned char *, int)); struct group *clone_group PROTO ((struct group *, char *)); void write_leases PROTO ((void)); void dump_subnets PROTO ((void)); @@ -735,7 +735,7 @@ extern struct protocol *protocols; extern int quiet_interface_discovery; extern void (*bootp_packet_handler) PROTO ((struct interface_info *, struct dhcp_packet *, int, - unsigned short, + unsigned int, struct iaddr, struct hardware *)); extern struct timeout *timeouts; void discover_interfaces PROTO ((int)); @@ -754,9 +754,10 @@ void remove_protocol PROTO ((struct protocol *)); /* hash.c */ struct hash_table *new_hash PROTO ((void)); -void add_hash PROTO ((struct hash_table *, char *, int, unsigned char *)); -void delete_hash_entry PROTO ((struct hash_table *, char *, int)); -unsigned char *hash_lookup PROTO ((struct hash_table *, char *, int)); +void add_hash PROTO ((struct hash_table *, unsigned char *, + int, unsigned char *)); +void delete_hash_entry PROTO ((struct hash_table *, unsigned char *, int)); +unsigned char *hash_lookup PROTO ((struct hash_table *, unsigned char *, int)); /* tables.c */ extern struct option dhcp_options [256]; @@ -774,8 +775,8 @@ u_int16_t getUShort PROTO ((unsigned char *)); int16_t getShort PROTO ((unsigned char *)); void putULong PROTO ((unsigned char *, u_int32_t)); void putLong PROTO ((unsigned char *, int32_t)); -void putUShort PROTO ((unsigned char *, u_int16_t)); -void putShort PROTO ((unsigned char *, int16_t)); +void putUShort PROTO ((unsigned char *, unsigned int)); +void putShort PROTO ((unsigned char *, int)); /* inet.c */ struct iaddr subnet_number PROTO ((struct iaddr, struct iaddr)); @@ -914,7 +915,7 @@ void parse_reject_statement PROTO ((FILE *, struct client_config *)); /* dhcrelay.c */ void relay PROTO ((struct interface_info *, struct dhcp_packet *, int, - unsigned short, struct iaddr, struct hardware *)); + unsigned int, struct iaddr, struct hardware *)); /* icmp.c */ void icmp_startup PROTO ((int, void (*) PROTO ((struct iaddr, diff --git a/includes/hash.h b/includes/hash.h index d30072b3c..1bebb3140 100644 --- a/includes/hash.h +++ b/includes/hash.h @@ -3,7 +3,8 @@ Definitions for hashing... */ /* - * Copyright (c) 1995 The Internet Software Consortium. All rights reserved. + * Copyright (c) 1995, 1996 The Internet Software Consortium. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,7 +44,7 @@ struct hash_bucket { struct hash_bucket *next; - char *name; + unsigned char *name; int len; unsigned char *value; }; diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c index 1631211a6..77c186ea2 100644 --- a/relay/dhcrelay.c +++ b/relay/dhcrelay.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcrelay.c,v 1.9.2.3 1998/06/25 18:34:47 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcrelay.c,v 1.9.2.4 1998/06/25 21:11:34 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -233,7 +233,7 @@ void relay (ip, packet, length, from_port, from, hfrom) struct interface_info *ip; struct dhcp_packet *packet; int length; - u_int16_t from_port; + unsigned int from_port; struct iaddr from; struct hardware *hfrom; { diff --git a/server/confpars.c b/server/confpars.c index b8487c16f..7dbd8ba90 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.45 1997/10/27 20:22:40 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.45.2.1 1998/06/25 21:11:34 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -890,8 +890,9 @@ void parse_option_param (cfile, group) /* Look up the option name hash table for the specified vendor. */ - universe = (struct universe *)hash_lookup (&universe_hash, - vendor, 0); + universe = ((struct universe *) + hash_lookup (&universe_hash, + (unsigned char *)vendor, 0)); /* If it's not there, we can't parse the rest of the declaration. */ if (!universe) { @@ -907,7 +908,8 @@ void parse_option_param (cfile, group) } /* Look up the actual option info... */ - option = (struct option *)hash_lookup (universe -> hash, val, 0); + option = (struct option *)hash_lookup (universe -> hash, + (unsigned char *)val, 0); /* If we didn't get an option structure, it's an undefined option. */ if (!option) { @@ -958,7 +960,8 @@ void parse_option_param (cfile, group) token = next_token (&val, cfile); tree = tree_concat (tree, - tree_const (val, + tree_const ((unsigned char *) + val, strlen (val))); } else { parse_warn ("expecting string %s.", @@ -977,9 +980,10 @@ void parse_option_param (cfile, group) skip_to_semi (cfile); return; } - tree = tree_concat (tree, - tree_const (val, - strlen (val))); + tree = tree_concat + (tree, + tree_const ((unsigned char *)val, + strlen (val))); break; case 'I': /* IP address or hostname. */ diff --git a/server/dhcp.c b/server/dhcp.c index e1c261272..94c31c5fb 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -3,7 +3,7 @@ DHCP Protocol engine. */ /* - * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,14 +42,14 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.57.2.1 1998/05/18 05:28:06 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.57.2.2 1998/06/25 21:11:35 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" int outstanding_pings; -static unsigned char dhcp_message [256]; +static char dhcp_message [256]; void dhcp (packet) struct packet *packet; @@ -427,9 +427,9 @@ void nak_lease (packet, cip) /* Set DHCP_MESSAGE to whatever the message is */ options [DHO_DHCP_MESSAGE] = &dhcpmsg_tree; - options [DHO_DHCP_MESSAGE] -> value = dhcp_message; - options [DHO_DHCP_MESSAGE] -> len = strlen (dhcp_message); - options [DHO_DHCP_MESSAGE] -> buf_size = strlen (dhcp_message); + options [DHO_DHCP_MESSAGE] -> value = (unsigned char *)dhcp_message; + options [DHO_DHCP_MESSAGE] -> len = + options [DHO_DHCP_MESSAGE] -> buf_size = strlen (dhcp_message); options [DHO_DHCP_MESSAGE] -> timeout = 0xFFFFFFFF; options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0; @@ -521,7 +521,7 @@ void nak_lease (packet, cip) void ack_lease (packet, lease, offer, when) struct packet *packet; struct lease *lease; - unsigned char offer; + unsigned int offer; TIME when; { struct lease lt;