2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

Fix a couple of const problems in a bogus way.

This commit is contained in:
Ted Lemon
1999-10-25 15:14:52 +00:00
parent 63c8c1dcf9
commit ade8a79a8e

View File

@@ -25,7 +25,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: nsupdate.c,v 1.12 1999/10/14 17:47:54 mellon Exp $ Copyright (c) 1999 The Internet Software Consortium. All rights reserved.\n"; "$Id: nsupdate.c,v 1.13 1999/10/25 15: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"
@@ -43,7 +43,7 @@ static char copyright[] =
be done by giving it pre-requisites to the add/delete. be done by giving it pre-requisites to the add/delete.
*/ */
#define NAME(x) (x) ? (char *)(x) : "(null)" #define NAME(x) (x) ? (const char *)(x) : "(null)"
#if 0 #if 0
/* Return the reverse name of a lease. */ /* Return the reverse name of a lease. */
@@ -205,7 +205,9 @@ int nsupdateA (hostname, ip_addr, ttl, opcode)
if (!(u = res_mkupdrec (S_UPDATE, hostname, C_IN, T_A, ttl))) if (!(u = res_mkupdrec (S_UPDATE, hostname, C_IN, T_A, ttl)))
return 0; return 0;
u -> r_opcode = opcode; u -> r_opcode = opcode;
u -> r_data = (char *)ip_addr; /* XXX ns_updrec doesn't have consts in 8.2.2! This cast is
of course bogus.*/
(const char *)(u -> r_data) = ip_addr;
#if 0 /* no PREREQUISITES are needed for adds and deletes, as there is no zone #if 0 /* no PREREQUISITES are needed for adds and deletes, as there is no zone
churn when you add a record that exists or delete a record that churn when you add a record that exists or delete a record that
@@ -258,8 +260,8 @@ int nsupdateA (hostname, ip_addr, ttl, opcode)
} }
z = res_update (u); z = res_update (u);
log_info ("%s %s: %s %ld IN A %s", opcode == ADD ? "add" : "delete", log_info ("%s %s: %s %ld IN A %s", opcode == ADD ? "add" : "delete",
z == 1 ? "succeeded" : "failed", NAME (hostname), ttl, z == 1 ? "succeeded" : "failed", NAME (hostname),
NAME (u -> r_data)); (unsigned long)ttl, NAME (u -> r_data));
#if 0 #if 0
res_freeupdrec (p); res_freeupdrec (p);
#endif #endif
@@ -280,7 +282,7 @@ int nsupdatePTR (revname, hostname, ttl, opcode)
if (!(u = res_mkupdrec (S_UPDATE, revname, C_IN, T_PTR, ttl))) if (!(u = res_mkupdrec (S_UPDATE, revname, C_IN, T_PTR, ttl)))
return 0; return 0;
u -> r_opcode = opcode; u -> r_opcode = opcode;
u -> r_data = (char *)hostname; (const char *)(u -> r_data) = hostname;
#if 0 /* don't need PREREQUISITES */ #if 0 /* don't need PREREQUISITES */
/* set up the prerequisite section */ /* set up the prerequisite section */
@@ -333,7 +335,7 @@ int nsupdatePTR (revname, hostname, ttl, opcode)
z = res_update(u); z = res_update(u);
log_info ("%s %s: %s %ld IN PTR %s", opcode == ADD ? "add" : log_info ("%s %s: %s %ld IN PTR %s", opcode == ADD ? "add" :
"delete", z == 1 ? "succeeded" : "failed", "delete", z == 1 ? "succeeded" : "failed",
NAME (revname), ttl, NAME (u -> r_data)); NAME (revname), (unsigned long)ttl, NAME (u -> r_data));
#if 0 #if 0
res_freeupdrec (p); res_freeupdrec (p);
#endif #endif