2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-01 06:45:27 +00:00

Type cast fixes for Solaris, from Brian Murrell.

This commit is contained in:
Ted Lemon
1999-09-16 01:19:52 +00:00
parent 0ddb129d9f
commit 0880c73c62
2 changed files with 17 additions and 17 deletions

View File

@@ -22,7 +22,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: memory.c,v 1.57 1999/09/15 19:47:27 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; "$Id: memory.c,v 1.58 1999/09/16 01:19:52 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -155,14 +155,14 @@ void enter_host (hd, dynamicp, commit)
} else { } else {
hp = (struct host_decl *) hp = (struct host_decl *)
hash_lookup (host_name_hash, hash_lookup (host_name_hash,
hd -> name, (unsigned char *)hd -> name,
strlen (hd -> name)); strlen (hd -> name));
/* If there isn't already a host decl matching this /* If there isn't already a host decl matching this
address, add it to the hash table. */ address, add it to the hash table. */
if (!hp) { if (!hp) {
add_hash (host_name_hash, add_hash (host_name_hash,
hd -> name, strlen (hd -> name), (unsigned char *)hd -> name, strlen (hd -> name),
(unsigned char *)hd); (unsigned char *)hd);
hd -> refcnt++; /* XXX */ hd -> refcnt++; /* XXX */
} else } else
@@ -284,14 +284,14 @@ void delete_host (hd, commit)
add_hash (host_uid_hash, add_hash (host_uid_hash,
hd -> n_ipaddr -> client_identifier.data, hd -> n_ipaddr -> client_identifier.data,
hd -> n_ipaddr -> client_identifier.len, hd -> n_ipaddr -> client_identifier.len,
(char *)hd -> n_ipaddr); (unsigned char *)hd -> n_ipaddr);
hd -> n_ipaddr -> refcnt++; hd -> n_ipaddr -> refcnt++;
} }
if (hw_head && hd -> n_ipaddr -> interface.hlen) { if (hw_head && hd -> n_ipaddr -> interface.hlen) {
add_hash (host_hw_addr_hash, add_hash (host_hw_addr_hash,
hd -> n_ipaddr -> interface.haddr, hd -> n_ipaddr -> interface.haddr,
hd -> n_ipaddr -> interface.hlen, hd -> n_ipaddr -> interface.hlen,
(char *)hd -> n_ipaddr); (unsigned char *)hd -> n_ipaddr);
hd -> n_ipaddr -> refcnt++; hd -> n_ipaddr -> refcnt++;
} }
omapi_object_dereference ((omapi_object_t **)&hd -> n_ipaddr, omapi_object_dereference ((omapi_object_t **)&hd -> n_ipaddr,
@@ -301,12 +301,12 @@ void delete_host (hd, commit)
if (host_name_hash) { if (host_name_hash) {
hp = (struct host_decl *) hp = (struct host_decl *)
hash_lookup (host_name_hash, hash_lookup (host_name_hash,
hd -> name, strlen (hd -> name)); (unsigned char *)hd -> name, strlen (hd -> name));
if (hp) { if (hp) {
if (hp == hd) { if (hp == hd) {
delete_hash_entry (host_name_hash, delete_hash_entry (host_name_hash,
hd -> name, (unsigned char *)hd -> name,
strlen (hd -> name)); strlen (hd -> name));
--hd -> refcnt; --hd -> refcnt;
} }

View File

@@ -25,7 +25,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: nsupdate.c,v 1.7 1999/07/31 17:57:36 mellon Exp $ Copyright (c) 1999 The Internet Software Consortium. All rights reserved.\n"; "$Id: nsupdate.c,v 1.8 1999/09/16 01:14:52 mellon Exp $ Copyright (c) 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -187,7 +187,7 @@ char *ddns_fwd_name(lease, state, packet)
static int nsupdateA(hostname, ip_addr, ttl, opcode) static int nsupdateA(hostname, ip_addr, ttl, opcode)
char *hostname; char *hostname;
char *ip_addr; unsigned char *ip_addr;
u_int32_t ttl; u_int32_t ttl;
int opcode; int opcode;
{ {
@@ -205,7 +205,7 @@ static int nsupdateA(hostname, ip_addr, ttl, opcode)
} }
n->r_opcode = opcode; n->r_opcode = opcode;
n->r_data = ip_addr; n->r_data = ip_addr;
n->r_size = strlen(n->r_data); n->r_size = strlen((const char *)n->r_data);
u->r_next = n; u->r_next = n;
z = res_update(u); z = res_update(u);
log_info("add %s: %s %d IN A %s", log_info("add %s: %s %d IN A %s",
@@ -234,7 +234,7 @@ static int nsupdateA(hostname, ip_addr, ttl, opcode)
return 0; return 0;
u->r_opcode = opcode; u->r_opcode = opcode;
u->r_data = ip_addr; u->r_data = ip_addr;
u->r_size = strlen(u->r_data); u->r_size = strlen((const char *)u->r_data);
z = res_update(u); z = res_update(u);
log_info("delete %s: %s %d IN A %s", log_info("delete %s: %s %d IN A %s",
z == 1 ? "succeeded" : "failed", z == 1 ? "succeeded" : "failed",
@@ -246,7 +246,7 @@ static int nsupdateA(hostname, ip_addr, ttl, opcode)
} }
static int nsupdatePTR(revname, hostname, ttl, opcode) static int nsupdatePTR(revname, hostname, ttl, opcode)
char *hostname; unsigned char *hostname;
char *revname; char *revname;
u_int32_t ttl; u_int32_t ttl;
int opcode; int opcode;
@@ -260,7 +260,7 @@ static int nsupdatePTR(revname, hostname, ttl, opcode)
return 0; return 0;
u->r_opcode = opcode; u->r_opcode = opcode;
u->r_data = hostname; u->r_data = hostname;
u->r_size = strlen(u->r_data); u->r_size = strlen((const char *)u->r_data);
z = res_update(u); z = res_update(u);
log_info("%s %s: %s %d IN PTR %s", log_info("%s %s: %s %d IN PTR %s",
opcode == ADD ? "add" : opcode == ADD ? "add" :
@@ -426,11 +426,11 @@ int updateA(struct data_string *lhs, struct data_string *rhs, unsigned int ttl,
static char ipaddr[MAXDNAME]; static char ipaddr[MAXDNAME];
hostname[0] = '\0'; hostname[0] = '\0';
strncat(hostname, lhs->data, lhs->len); strncat(hostname, (const char *)lhs->data, lhs->len);
hostname[lhs->len] = '\0'; hostname[lhs->len] = '\0';
ipaddr[0] = '\0'; ipaddr[0] = '\0';
strncat(ipaddr, rhs->data, rhs->len); strncat(ipaddr, (const char *)rhs->data, rhs->len);
ipaddr[rhs->len] = '\0'; ipaddr[rhs->len] = '\0';
/* delete an existing A if the one to be added is different */ /* delete an existing A if the one to be added is different */
@@ -471,11 +471,11 @@ int updatePTR(struct data_string *lhs, struct data_string *rhs,
static char revname[MAXDNAME]; static char revname[MAXDNAME];
revname[0] = '\0'; revname[0] = '\0';
strncat(revname, lhs->data, lhs->len); strncat(revname, (const char *)lhs->data, lhs->len);
revname[lhs->len] = '\0'; revname[lhs->len] = '\0';
hostname[0] = '\0'; hostname[0] = '\0';
strncat(hostname, rhs->data, rhs->len); strncat(hostname, (const char *)rhs->data, rhs->len);
hostname[rhs->len] = '\0'; hostname[rhs->len] = '\0';
/* delete an existing PTR if the one to be added is different */ /* delete an existing PTR if the one to be added is different */