summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/dhc6.c53
-rw-r--r--client/dhclient.c6
-rw-r--r--common/alloc.c6
-rw-r--r--common/discover.c12
-rw-r--r--common/dns.c2
-rw-r--r--common/options.c10
-rw-r--r--common/socket.c22
-rw-r--r--common/tables.c2
-rw-r--r--common/tree.c12
-rwxr-xr-xconfigure32
-rw-r--r--configure.ac28
-rw-r--r--dhcpctl/remote.c4
-rw-r--r--dst/dst_api.c13
-rw-r--r--includes/dhcp6.h2
-rw-r--r--includes/dhcpd.h97
-rw-r--r--includes/minires/minires.h9
-rw-r--r--minires/ns_verify.c6
-rw-r--r--omapip/array.c1
-rw-r--r--omapip/connection.c5
-rw-r--r--omapip/mrtrace.c2
-rw-r--r--server/dhcpv6.c8
21 files changed, 164 insertions, 168 deletions
diff --git a/client/dhc6.c b/client/dhc6.c
index 17a69617..1b768a9e 100644
--- a/client/dhc6.c
+++ b/client/dhc6.c
@@ -33,11 +33,12 @@ struct option *iaaddr_option = NULL;
struct option *elapsed_option = NULL;
static struct dhc6_lease *dhc6_dup_lease(struct dhc6_lease *lease,
- char *file, int line);
-static struct dhc6_ia *dhc6_dup_ia(struct dhc6_ia *ia, char *file, int line);
+ const char *file, int line);
+static struct dhc6_ia *dhc6_dup_ia(struct dhc6_ia *ia,
+ const char *file, int line);
static struct dhc6_addr *dhc6_dup_addr(struct dhc6_addr *addr,
- char *file, int line);
-static void dhc6_ia_destroy(struct dhc6_ia *ia, char *file, int line);
+ const char *file, int line);
+static void dhc6_ia_destroy(struct dhc6_ia *ia, const char *file, int line);
static isc_result_t dhc6_parse_ia_na(struct dhc6_ia **pia,
struct packet *packet,
struct option_state *options);
@@ -68,7 +69,8 @@ void do_expire(void *input);
static void make_client6_options(struct client_state *client,
struct option_state **op,
struct dhc6_lease *lease, u_int8_t message);
-static void script_write_params6(struct client_state *client, char *prefix,
+static void script_write_params6(struct client_state *client,
+ const char *prefix,
struct option_state *options);
/* The "best" default DUID, since we cannot predict any information
@@ -85,7 +87,7 @@ static void script_write_params6(struct client_state *client, char *prefix,
* address this "one daemon model."
*/
void
-form_duid(struct data_string *duid, char *file, int line)
+form_duid(struct data_string *duid, const char *file, int line)
{
struct interface_info *ip;
int len;
@@ -350,7 +352,7 @@ valid_reply(struct packet *packet, struct client_state *client)
/* Create a complete copy of a DHCPv6 lease structure.
*/
static struct dhc6_lease *
-dhc6_dup_lease(struct dhc6_lease *lease, char *file, int line)
+dhc6_dup_lease(struct dhc6_lease *lease, const char *file, int line)
{
struct dhc6_lease *copy;
struct dhc6_ia **insert_ia, *ia;
@@ -387,7 +389,7 @@ dhc6_dup_lease(struct dhc6_lease *lease, char *file, int line)
/* Duplicate an IA structure.
*/
static struct dhc6_ia *
-dhc6_dup_ia(struct dhc6_ia *ia, char *file, int line)
+dhc6_dup_ia(struct dhc6_ia *ia, const char *file, int line)
{
struct dhc6_ia *copy;
struct dhc6_addr **insert_addr, *addr;
@@ -422,7 +424,7 @@ dhc6_dup_ia(struct dhc6_ia *ia, char *file, int line)
/* Duplicate an IAADDR structure.
*/
static struct dhc6_addr *
-dhc6_dup_addr(struct dhc6_addr *addr, char *file, int line)
+dhc6_dup_addr(struct dhc6_addr *addr, const char *file, int line)
{
struct dhc6_addr *copy;
@@ -719,7 +721,7 @@ dhc6_parse_addrs(struct dhc6_addr **paddr, struct packet *packet,
/* Clean up a lease object and deallocate all its parts. */
void
-dhc6_lease_destroy(struct dhc6_lease *lease, char *file, int line)
+dhc6_lease_destroy(struct dhc6_lease *lease, const char *file, int line)
{
struct dhc6_ia *ia, *nia;
@@ -744,7 +746,7 @@ dhc6_lease_destroy(struct dhc6_lease *lease, char *file, int line)
/* Traverse the addresses list, and destroy their contents. */
static void
-dhc6_ia_destroy(struct dhc6_ia *ia, char *file, int line)
+dhc6_ia_destroy(struct dhc6_ia *ia, const char *file, int line)
{
struct dhc6_addr *addr, *naddr;
@@ -992,7 +994,7 @@ do_init6(void *input)
if ((client->active_lease != NULL) &&
((old_ia = find_ia(client->active_lease->bindings,
- (char *)ia.data)) != NULL)) {
+ (char *)ia.buffer->data)) != NULL)) {
/* For each address in the old IA, request a binding. */
memset(&addr, 0, sizeof(addr));
for (old_addr = old_ia->addrs ; old_addr != NULL ;
@@ -1204,7 +1206,6 @@ do_release6(void *input)
struct client_state *client;
struct data_string ds;
struct option_cache *oc;
- struct dhc6_lease *lease;
int send_ret;
client = input;
@@ -1221,10 +1222,11 @@ do_release6(void *input)
* Check whether the server has sent a unicast option; if so, we can
* use the address it specified.
*/
- oc = lookup_option(&dhcpv6_universe, lease->options, D6O_UNICAST);
+ oc = lookup_option(&dhcpv6_universe,
+ client->active_lease->options, D6O_UNICAST);
if (oc && evaluate_option_cache(&ds, NULL, NULL, NULL,
- lease->options, NULL, &global_scope,
- oc, MDL)) {
+ client->active_lease->options,
+ NULL, &global_scope, oc, MDL)) {
if (ds.len < 16) {
log_error("Invalid unicast option length %d.", ds.len);
} else {
@@ -1285,9 +1287,9 @@ do_release6(void *input)
* to info level.
*/
static void
-status_log(int code, char *scope, const char *additional, int len)
+status_log(int code, const char *scope, const char *additional, int len)
{
- char *msg = NULL;
+ const char *msg = NULL;
switch(code) {
case STATUS_Success:
@@ -1320,7 +1322,8 @@ status_log(int code, char *scope, const char *additional, int len)
if (len > 0)
log_info("%s status code %s: %s", scope, msg,
- print_hex_1(len, (unsigned char *)additional, 50));
+ print_hex_1(len,
+ (const unsigned char *)additional, 50));
else
log_info("%s status code %s.", scope, msg);
}
@@ -1373,7 +1376,7 @@ dhc6_get_status_code(struct option_state *options, unsigned *code,
*/
static isc_result_t
dhc6_check_status(isc_result_t rval, struct option_state *options,
- char *scope, unsigned *code)
+ const char *scope, unsigned *code)
{
struct data_string msg;
isc_result_t status;
@@ -2353,7 +2356,7 @@ reply_handler(struct packet *packet, struct client_state *client)
* over-written by the later versions.
*/
static void
-dhc6_marshall_values(char *prefix, struct client_state *client,
+dhc6_marshall_values(const char *prefix, struct client_state *client,
struct dhc6_lease *lease, struct dhc6_ia *ia,
struct dhc6_addr *addr)
{
@@ -2656,7 +2659,7 @@ start_bound(struct client_state *client)
struct dhc6_ia *ia, *oldia;
struct dhc6_addr *addr, *oldaddr;
struct dhc6_lease *lease, *old;
- char *reason;
+ const char *reason;
TIME dns_update_offset = 1;
lease = client->active_lease;
@@ -3089,7 +3092,6 @@ do_expire(void *input)
void
unconfigure6(struct client_state *client, const char *reason)
{
- struct dhc6_lease *lease;
struct dhc6_ia *ia;
struct dhc6_addr *addr;
@@ -3099,7 +3101,8 @@ unconfigure6(struct client_state *client, const char *reason)
for (ia = client->active_lease->bindings ; ia != NULL ; ia = ia->next) {
for (addr = ia->addrs ; addr != NULL ; addr = addr->next) {
script_init(client, reason, NULL);
- dhc6_marshall_values("old_", client, lease, ia, addr);
+ dhc6_marshall_values("old_", client,
+ client->active_lease, ia, addr);
script_go(client);
if (client->config->do_forward_update)
@@ -3200,7 +3203,7 @@ make_client6_options(struct client_state *client, struct option_state **op,
* generic lines.
*/
static void
-script_write_params6(struct client_state *client, char *prefix,
+script_write_params6(struct client_state *client, const char *prefix,
struct option_state *options)
{
struct envadd_state es;
diff --git a/client/dhclient.c b/client/dhclient.c
index 790738c0..3f6679e2 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -2416,14 +2416,14 @@ void write_lease_option (struct option_cache *oc,
/* Write an option cache to the lease store. */
static void
write_options(struct client_state *client, struct option_state *options,
- char *preamble)
+ const char *preamble)
{
int i;
for (i = 0; i < options->universe_count; i++) {
option_space_foreach(NULL, NULL, client, NULL, options,
- &global_scope, universes[i], preamble,
- write_lease_option);
+ &global_scope, universes[i],
+ (char *)preamble, write_lease_option);
}
}
diff --git a/common/alloc.c b/common/alloc.c
index 9e18c6f6..d825de59 100644
--- a/common/alloc.c
+++ b/common/alloc.c
@@ -411,7 +411,7 @@ void free_pair (foo, file, line)
{
foo -> cdr = free_pairs;
free_pairs = foo;
- dmalloc_reuse (free_pairs, (char *)0, 0, 0);
+ dmalloc_reuse (free_pairs, __FILE__, __LINE__, 0);
}
#if defined (DEBUG_MEMORY_LEAKAGE) || \
@@ -485,7 +485,7 @@ void free_expression (expr, file, line)
{
expr -> data.not = free_expressions;
free_expressions = expr;
- dmalloc_reuse (free_expressions, (char *)0, 0, 0);
+ dmalloc_reuse (free_expressions, __FILE__, __LINE__, 0);
}
#if defined (DEBUG_MEMORY_LEAKAGE) || \
@@ -1134,7 +1134,7 @@ int packet_dereference (ptr, file, line)
}
packet -> raw = (struct dhcp_packet *)free_packets;
free_packets = packet;
- dmalloc_reuse (free_packets, (char *)0, 0, 0);
+ dmalloc_reuse (free_packets, __FILE__, __LINE__, 0);
return 1;
}
diff --git a/common/discover.c b/common/discover.c
index c2488dc7..350dc476 100644
--- a/common/discover.c
+++ b/common/discover.c
@@ -1216,16 +1216,18 @@ discover_interfaces(int state) {
continue;
if (tmp -> rfdesc == -1)
continue;
- if (local_family == AF_INET) {
+#ifdef DHCPv6
+ if (local_family == AF_INET6) {
status = omapi_register_io_object((omapi_object_t *)tmp,
if_readsocket,
- 0, got_one, 0, 0);
-#ifdef DHCPv6
+ 0, got_one_v6, 0, 0);
} else {
+#else
+ {
+#endif /* DHCPv6 */
status = omapi_register_io_object((omapi_object_t *)tmp,
if_readsocket,
- 0, got_one_v6, 0, 0);
-#endif /* DHCPv6 */
+ 0, got_one, 0, 0);
}
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register I/O handle for %s: %s",
diff --git a/common/dns.c b/common/dns.c
index adf3f55e..878caf5b 100644
--- a/common/dns.c
+++ b/common/dns.c
@@ -206,7 +206,7 @@ isc_result_t dns_zone_lookup (struct dns_zone **zone, const char *name)
if (name [len - 1] != '.') {
tname = dmalloc ((unsigned)len + 2, MDL);
if (!tname)
- return ISC_R_NOMEMORY;;
+ return ISC_R_NOMEMORY;
strcpy (tname, name);
tname [len] = '.';
tname [len + 1] = 0;
diff --git a/common/options.c b/common/options.c
index aa18fa65..ef9a32be 100644
--- a/common/options.c
+++ b/common/options.c
@@ -2229,7 +2229,7 @@ collect_oro(struct option_cache *oc,
void *void_oro) {
struct data_string *oro = (struct data_string *)void_oro;
- putUShort((unsigned char *)(oro->data + oro->len), oc->option->code);
+ putUShort(oro->buffer->data + oro->len, oc->option->code);
oro->len += 2;
}
@@ -2285,7 +2285,7 @@ build_server_oro(struct data_string *server_oro,
while (o != NULL) {
if (o->universe == &dhcpv6_universe) {
unsigned char *tmp;
- tmp = (unsigned char *)server_oro->data;
+ tmp = server_oro->buffer->data;
putUShort(tmp + server_oro->len,
o->code);
server_oro->len += 2;
@@ -2635,7 +2635,7 @@ int option_space_encapsulate (result, packet, lease, client_state,
int status = 0;
universe_hash_lookup(&u, universe_hash,
- (char *)name->data, name->len, MDL);
+ (const char *)name->data, name->len, MDL);
if (u == NULL) {
log_error("option_space_encapsulate: option space %.*s does "
"not exist, but is configured.",
@@ -3659,7 +3659,7 @@ do_packet6(struct interface_info *interface, const char *packet,
msg_type = packet[0];
if ((msg_type == DHCPV6_RELAY_FORW) ||
(msg_type == DHCPV6_RELAY_REPL)) {
- relay = (struct dhcpv6_relay_packet *)packet;
+ relay = (const struct dhcpv6_relay_packet *)packet;
decoded_packet->dhcpv6_msg_type = relay->msg_type;
/* relay-specific data */
@@ -3678,7 +3678,7 @@ do_packet6(struct interface_info *interface, const char *packet,
return;
}
} else {
- msg = (struct dhcpv6_packet *)packet;
+ msg = (const struct dhcpv6_packet *)packet;
decoded_packet->dhcpv6_msg_type = msg->msg_type;
/* message-specific data */
diff --git a/common/socket.c b/common/socket.c
index ccd8ae08..13904a35 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -120,17 +120,8 @@ if_register_socket(struct interface_info *info, int family, int do_multicast) {
* address family.
*/
memset(&name, 0, sizeof(name));
- if (family == AF_INET) {
- struct sockaddr_in *addr = (struct sockaddr_in *)&name;
- addr->sin_family = AF_INET;
- addr->sin_port = local_port;
- memcpy(&addr->sin_addr,
- &local_address,
- sizeof(addr->sin_addr));
- name_len = sizeof(*addr);
- domain = PF_INET;
#ifdef DHCPv6
- } else {
+ if (family == AF_INET6) {
struct sockaddr_in6 *addr = (struct sockaddr_in6 *)&name;
addr->sin6_family = AF_INET6;
addr->sin6_port = local_port;
@@ -139,7 +130,18 @@ if_register_socket(struct interface_info *info, int family, int do_multicast) {
sizeof(addr->sin6_addr));
name_len = sizeof(*addr);
domain = PF_INET6;
+ } else {
+#else
+ {
#endif /* DHCPv6 */
+ struct sockaddr_in *addr = (struct sockaddr_in *)&name;
+ addr->sin_family = AF_INET;
+ addr->sin_port = local_port;
+ memcpy(&addr->sin_addr,
+ &local_address,
+ sizeof(addr->sin_addr));
+ name_len = sizeof(*addr);
+ domain = PF_INET;
}
/* Make a socket... */
diff --git a/common/tables.c b/common/tables.c
index 6d8a5df9..5b945620 100644
--- a/common/tables.c
+++ b/common/tables.c
@@ -474,7 +474,7 @@ struct enumeration_value dhcpv6_message_values[] = {
};
/* Some code refers to a different table. */
-char *dhcpv6_type_names[] = {
+const char *dhcpv6_type_names[] = {
NULL,
"Solicit",
"Advertise",
diff --git a/common/tree.c b/common/tree.c
index 68844bef..aa5903af 100644
--- a/common/tree.c
+++ b/common/tree.c
@@ -1002,7 +1002,7 @@ int evaluate_boolean_expression (result, packet, lease, client_state,
struct binding *binding;
struct binding_value *bv, *obv;
#ifdef HAVE_REGEX_H
- int reg_st, regflags = REG_EXTENDED | REG_NOSUB;
+ int regflags = REG_EXTENDED | REG_NOSUB;
regex_t re;
#endif
@@ -1139,7 +1139,15 @@ int evaluate_boolean_expression (result, packet, lease, client_state,
data_string_forget(&right, MDL);
regfree(&re);
- return reg_st;
+
+ /*
+ * If we have bleft and bright then we have a good
+ * syntax, otherwise not.
+ *
+ * XXX: we don't warn on invalid regular expression
+ * syntax, should we?
+ */
+ return bleft && bright;
#else
/* It shouldn't be possible to configure a regex operator
* when there's no support.
diff --git a/configure b/configure
index 78e7acf5..f47602a4 100755
--- a/configure
+++ b/configure
@@ -2232,6 +2232,12 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+# We want to turn on warnings if we are using gcc and the user did
+# not specify CFLAGS. The autoconf check for the C compiler sets the
+# CFLAGS if gcc is used, so we will save it before we run that check.
+SAVE_CFLAGS="$CFLAGS"
+
+# Now find our C compiler.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3321,6 +3327,15 @@ else
fi
+
+# If we have gcc, and AC_PROG_CC changed the flags, then we know the
+# user did not specify any flags. Add warnings in this case.
+if test "$GCC" = "yes"; then
+ if test "$CFLAGS" != "$SAVE_CFLAGS"; then
+ CFLAGS="$CFLAGS -Wall -Werror -fno-strict-aliasing"
+ fi
+fi
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
@@ -6281,8 +6296,10 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <sys/types.h>
- #include <sys/socket.h>
+#include <sys/socket.h>
+
int
main ()
@@ -6322,8 +6339,10 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <sys/types.h>
- #include <sys/socket.h>
+#include <sys/socket.h>
+
int
main ()
@@ -6384,8 +6403,10 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <sys/types.h>
- #include <sys/socket.h>
+#include <sys/socket.h>
+
int
main ()
@@ -6425,8 +6446,10 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <sys/types.h>
- #include <sys/socket.h>
+#include <sys/socket.h>
+
int
main ()
@@ -6480,6 +6503,7 @@ echo "$as_me: error: Missing msg_control member in
{ (exit 1); exit 1; }; }
fi
+
fi
diff --git a/configure.ac b/configure.ac
index 0b0fd91f..706e80f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,22 @@ AC_INIT([DHCP], [4.0.0a2], [dhcp-users@isc.org])
# like AUTHORS, COPYING, and such
AM_INIT_AUTOMAKE([foreign])
+# We want to turn on warnings if we are using gcc and the user did
+# not specify CFLAGS. The autoconf check for the C compiler sets the
+# CFLAGS if gcc is used, so we will save it before we run that check.
+SAVE_CFLAGS="$CFLAGS"
+
+# Now find our C compiler.
AC_PROG_CC
+
+# If we have gcc, and AC_PROG_CC changed the flags, then we know the
+# user did not specify any flags. Add warnings in this case.
+if test "$GCC" = "yes"; then
+ if test "$CFLAGS" != "$SAVE_CFLAGS"; then
+ CFLAGS="$CFLAGS -Wall -Werror -fno-strict-aliasing"
+ fi
+fi
+
AC_PROG_RANLIB
AC_CONFIG_HEADERS([includes/config.h])
@@ -183,10 +198,15 @@ AC_CHECK_MEMBER(struct msghdr.msg_control,,
AC_CHECK_MEMBER(struct msghdr.msg_control,,
[AC_MSG_ERROR([Missing msg_control member in
msg_control structure.])],
- [#include <sys/types.h>
- #include <sys/socket.h>])],
- [#include <sys/types.h>
- #include <sys/socket.h>])
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+ ],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
AC_OUTPUT([
Makefile
diff --git a/dhcpctl/remote.c b/dhcpctl/remote.c
index 29af9c72..2ada64a1 100644
--- a/dhcpctl/remote.c
+++ b/dhcpctl/remote.c
@@ -118,8 +118,8 @@ dhcpctl_status dhcpctl_new_object (dhcpctl_handle *h,
isc_result_t status;
m = (dhcpctl_remote_object_t *)0;
- status = omapi_object_allocate ((omapi_object_t **)&m,
- dhcpctl_remote_type, 0, MDL);
+ status = omapi_object_allocate((omapi_object_t **)&m,
+ dhcpctl_remote_type, 0, MDL);
if (status != ISC_R_SUCCESS)
return status;
diff --git a/dst/dst_api.c b/dst/dst_api.c
index be629165..65015537 100644
--- a/dst/dst_api.c
+++ b/dst/dst_api.c
@@ -1,5 +1,5 @@
#ifndef LINT
-static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.3 2007/07/13 06:43:42 shane Exp $";
+static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.4 2007/08/22 13:41:37 shane Exp $";
#endif
/*
@@ -832,7 +832,8 @@ dst_s_read_private_key_file(char *name, DST_KEY *pk_key, unsigned in_id,
int cnt, alg, len, major, minor, file_major, file_minor;
int id;
char filename[PATH_MAX];
- u_char in_buff[RAW_KEY_SIZE], *p;
+ u_char in_buff[RAW_KEY_SIZE];
+ char *p;
FILE *fp;
if (name == NULL || pk_key == NULL) {
@@ -865,14 +866,14 @@ dst_s_read_private_key_file(char *name, DST_KEY *pk_key, unsigned in_id,
if (memcmp(in_buff, "Private-key-format: v", 20) != 0)
goto fail;
len = cnt;
- p = in_buff;
+ p = (char *)in_buff;
if (!dst_s_verify_str((const char **) &p, "Private-key-format: v")) {
EREPORT(("dst_s_read_private_key_file(): Not a Key file/Decrypt failed %s\n", name));
goto fail;
}
/* read in file format */
- sscanf((char *)p, "%d.%d", &file_major, &file_minor);
+ sscanf(p, "%d.%d", &file_major, &file_minor);
sscanf(KEY_FILE_FORMAT, "%d.%d", &major, &minor);
if (file_major < 1) {
EREPORT(("dst_s_read_private_key_file(): Unknown keyfile %d.%d version for %s\n",
@@ -888,7 +889,7 @@ dst_s_read_private_key_file(char *name, DST_KEY *pk_key, unsigned in_id,
if (!dst_s_verify_str((const char **) &p, "Algorithm: "))
goto fail;
- if (sscanf((char *)p, "%d", &alg) != 1)
+ if (sscanf(p, "%d", &alg) != 1)
goto fail;
while (*p++ != '\n') ; /* skip to end of line */
@@ -901,7 +902,7 @@ dst_s_read_private_key_file(char *name, DST_KEY *pk_key, unsigned in_id,
goto fail;
id = pk_key->dk_func->from_file_fmt(pk_key, (char *)p,
- (unsigned)(&in_buff[len] - p));
+ (unsigned)(&in_buff[len] - (u_char *)p));
if (id < 0)
goto fail;
diff --git a/includes/dhcp6.h b/includes/dhcp6.h
index be39c5b5..146302a3 100644
--- a/includes/dhcp6.h
+++ b/includes/dhcp6.h
@@ -94,7 +94,7 @@
#define DHCPV6_RELAY_FORW 12
#define DHCPV6_RELAY_REPL 13
-extern char *dhcpv6_type_names[];
+extern const char *dhcpv6_type_names[];
extern const int dhcpv6_type_name_max;
/* DUID type definitions (RFC3315 section 9).
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index df347d9d..c0418816 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -1543,15 +1543,10 @@ int add_option(struct option_state *options,
void *data,
unsigned int data_len);
-int add_option(struct option_state *options,
- unsigned int option_num,
- void *data,
- unsigned int data_len);
-
/* dhcpd.c */
extern TIME cur_time;
-int ddns_update_style;
+extern int ddns_update_style;
extern const char *path_dhcpd_conf;
extern const char *path_dhcpd_db;
@@ -1566,7 +1561,7 @@ void cleanup PROTO ((void));
void lease_pinged PROTO ((struct iaddr, u_int8_t *, int));
void lease_ping_timeout PROTO ((void *));
int dhcpd_interface_setup_hook (struct interface_info *ip, struct iaddr *ia);
-enum dhcp_shutdown_state shutdown_state;
+extern enum dhcp_shutdown_state shutdown_state;
isc_result_t dhcp_io_shutdown (omapi_object_t *, void *);
isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
control_object_state_t newstate);
@@ -1844,10 +1839,6 @@ void get_server_source_address(struct in_addr *from,
struct option_state *options,
struct packet *packet);
-void get_server_source_address(struct in_addr *from,
- struct option_state *options,
- struct packet *packet);
-
/* dhcpv6.c */
isc_boolean_t server_duid_isset(void);
void copy_server_duid(struct data_string *ds, const char *file, int line);
@@ -1861,7 +1852,7 @@ void dhcpv6(struct packet *);
void bootp PROTO ((struct packet *));
/* memory.c */
-int (*group_write_hook) (struct group_object *);
+extern int (*group_write_hook) (struct group_object *);
extern struct group *root_group;
extern group_hash_t *group_name_hash;
isc_result_t delete_group (struct group_object *, int);
@@ -1919,9 +1910,6 @@ struct option *new_option PROTO ((const char *, const char *, int));
int option_reference(struct option **dest, struct option *src,
const char * file, int line);
int option_dereference(struct option **dest, const char *file, int line);
-int group_allocate (struct group **, const char *, int);
-int group_reference (struct group **, struct group *, const char *, int);
-int group_dereference (struct group **, const char *, int);
struct universe *new_universe PROTO ((const char *, int));
void free_universe PROTO ((struct universe *, const char *, int));
void free_domain_search_list PROTO ((struct domain_search_list *,
@@ -2224,7 +2212,7 @@ extern u_int16_t remote_port;
extern int (*dhcp_interface_setup_hook) (struct interface_info *,
struct iaddr *);
extern int (*dhcp_interface_discovery_hook) (struct interface_info *);
-isc_result_t (*dhcp_interface_startup_hook) (struct interface_info *);
+extern isc_result_t (*dhcp_interface_startup_hook) (struct interface_info *);
extern void (*bootp_packet_handler) PROTO ((struct interface_info *,
struct dhcp_packet *, unsigned,
@@ -2236,9 +2224,9 @@ extern void (*dhcpv6_packet_handler)(struct interface_info *,
extern struct timeout *timeouts;
extern omapi_object_type_t *dhcp_type_interface;
#if defined (TRACING)
-trace_type_t *interface_trace;
-trace_type_t *inpacket_trace;
-trace_type_t *outpacket_trace;
+extern trace_type_t *interface_trace;
+extern trace_type_t *inpacket_trace;
+extern trace_type_t *outpacket_trace;
#endif
extern struct interface_info **interface_vector;
extern int interface_count;
@@ -2291,11 +2279,11 @@ extern struct universe vsio_universe;
extern int dhcp_option_default_priority_list [];
extern int dhcp_option_default_priority_list_count;
extern const char *hardware_types [256];
-int universe_count, universe_max;
-struct universe **universes;
+extern int universe_count, universe_max;
+extern struct universe **universes;
extern universe_hash_t *universe_hash;
void initialize_common_option_spaces PROTO ((void));
-struct universe *config_universe;
+extern struct universe *config_universe;
/* stables.c */
#if defined (FAILOVER_PROTOCOL)
@@ -2419,15 +2407,12 @@ void dhcpv4_client_assignments(void);
void dhcpv6_client_assignments(void);
/* dhc6.c */
-void form_duid(struct data_string *duid, char *file, int line);
-void dhc6_lease_destroy(struct dhc6_lease *lease, char *file, int line);
+void form_duid(struct data_string *duid, const char *file, int line);
+void dhc6_lease_destroy(struct dhc6_lease *lease, const char *file, int line);
void start_init6(struct client_state *client);
void start_confirm6(struct client_state *client);
void start_release6(struct client_state *client);
void start_selecting6(struct client_state *client);
-isc_result_t write_client6_lease(struct client_state *client,
- struct dhc6_lease *lease,
- int rewrite, int sync);
void unconfigure6(struct client_state *client, const char *reason);
/* db.c */
@@ -2587,8 +2572,8 @@ isc_result_t ddns_remove_fwd(struct data_string *,
/* resolv.c */
extern char path_resolv_conf [];
-struct name_server *name_servers;
-struct domain_search_list *domains;
+extern struct name_server *name_servers;
+extern struct domain_search_list *domains;
void read_resolv_conf PROTO ((TIME));
struct name_server *first_name_server PROTO ((void));
@@ -2604,7 +2589,7 @@ struct class unknown_class;
struct class known_class;
struct collection default_collection;
struct collection *collections;
-struct executable_statement *default_classification_rules;
+extern struct executable_statement *default_classification_rules;
void classification_setup PROTO ((void));
void classify_client PROTO ((struct packet *));
@@ -2644,7 +2629,6 @@ int executable_statement_foreach (struct executable_statement *,
void *, int), void *, int);
/* comapi.c */
-extern omapi_object_type_t *dhcp_type_interface;
extern omapi_object_type_t *dhcp_type_group;
extern omapi_object_type_t *dhcp_type_shared_network;
extern omapi_object_type_t *dhcp_type_subnet;
@@ -2765,24 +2749,6 @@ isc_result_t dhcp_lease_create (omapi_object_t **,
omapi_object_t *);
isc_result_t dhcp_lease_remove (omapi_object_t *,
omapi_object_t *);
-isc_result_t dhcp_group_set_value (omapi_object_t *, omapi_object_t *,
- omapi_data_string_t *,
- omapi_typed_data_t *);
-isc_result_t dhcp_group_get_value (omapi_object_t *, omapi_object_t *,
- omapi_data_string_t *,
- omapi_value_t **);
-isc_result_t dhcp_group_destroy (omapi_object_t *, const char *, int);
-isc_result_t dhcp_group_signal_handler (omapi_object_t *,
- const char *, va_list);
-isc_result_t dhcp_group_stuff_values (omapi_object_t *,
- omapi_object_t *,
- omapi_object_t *);
-isc_result_t dhcp_group_lookup (omapi_object_t **,
- omapi_object_t *, omapi_object_t *);
-isc_result_t dhcp_group_create (omapi_object_t **,
- omapi_object_t *);
-isc_result_t dhcp_group_remove (omapi_object_t *,
- omapi_object_t *);
isc_result_t dhcp_host_set_value (omapi_object_t *, omapi_object_t *,
omapi_data_string_t *,
omapi_typed_data_t *);
@@ -2855,39 +2821,6 @@ isc_result_t dhcp_subclass_create (omapi_object_t **,
omapi_object_t *);
isc_result_t dhcp_subclass_remove (omapi_object_t *,
omapi_object_t *);
-isc_result_t dhcp_shared_network_set_value (omapi_object_t *,
- omapi_object_t *,
- omapi_data_string_t *,
- omapi_typed_data_t *);
-isc_result_t dhcp_shared_network_get_value (omapi_object_t *, omapi_object_t *,
- omapi_data_string_t *,
- omapi_value_t **);
-isc_result_t dhcp_shared_network_destroy (omapi_object_t *, const char *, int);
-isc_result_t dhcp_shared_network_signal_handler (omapi_object_t *,
- const char *, va_list);
-isc_result_t dhcp_shared_network_stuff_values (omapi_object_t *,
- omapi_object_t *,
- omapi_object_t *);
-isc_result_t dhcp_shared_network_lookup (omapi_object_t **,
- omapi_object_t *, omapi_object_t *);
-isc_result_t dhcp_shared_network_create (omapi_object_t **,
- omapi_object_t *);
-isc_result_t dhcp_subnet_set_value (omapi_object_t *, omapi_object_t *,
- omapi_data_string_t *,
- omapi_typed_data_t *);
-isc_result_t dhcp_subnet_get_value (omapi_object_t *, omapi_object_t *,
- omapi_data_string_t *,
- omapi_value_t **);
-isc_result_t dhcp_subnet_destroy (omapi_object_t *, const char *, int);
-isc_result_t dhcp_subnet_signal_handler (omapi_object_t *,
- const char *, va_list);
-isc_result_t dhcp_subnet_stuff_values (omapi_object_t *,
- omapi_object_t *,
- omapi_object_t *);
-isc_result_t dhcp_subnet_lookup (omapi_object_t **,
- omapi_object_t *, omapi_object_t *);
-isc_result_t dhcp_subnet_create (omapi_object_t **,
- omapi_object_t *);
isc_result_t dhcp_interface_set_value (omapi_object_t *,
omapi_object_t *,
omapi_data_string_t *,
diff --git a/includes/minires/minires.h b/includes/minires/minires.h
index 000196d4..1e64e93a 100644
--- a/includes/minires/minires.h
+++ b/includes/minires/minires.h
@@ -20,6 +20,8 @@
* <info@isc.org>
* http://www.isc.org/
*/
+#ifndef MINIRES_H
+#define MINIRES_H
#include "cdefs.h"
#include "osdep.h"
@@ -128,8 +130,6 @@ void res_buildservicelist (void);
void res_destroyservicelist (void);
void res_buildprotolist(void);
void res_destroyprotolist(void);
-int res_servicenumber(const char *);
-int res_protocolnumber(const char *);
const char *res_protocolname(int);
const char *res_servicename(u_int16_t, const char *);
u_int32_t ns_datetosecs (const char *cp, int *errp);
@@ -194,11 +194,8 @@ isc_result_t ns_sign_tcp_init (void *, const unsigned char *,
unsigned, ns_tcp_tsig_state *);
isc_result_t ns_sign_tcp (unsigned char *,
unsigned *, unsigned, int, ns_tcp_tsig_state *, int);
-int ns_name_pton (const char *, unsigned char *, size_t);
int ns_name_pack (const unsigned char *, unsigned char *,
unsigned, const unsigned char **, const unsigned char **);
-int ns_name_compress (const char *, unsigned char *,
- size_t, const unsigned char **, const unsigned char **);
int ns_name_skip (const unsigned char **, const unsigned char *);
int ns_subdomain (const char *, const char *);
unsigned char *ns_find_tsig (unsigned char *, unsigned char *);
@@ -232,3 +229,5 @@ isc_result_t ns_rcode_to_isc (int);
#if defined (TRACING)
void trace_mr_statp_setup (res_state);
#endif
+
+#endif /* MINIRES_H */
diff --git a/minires/ns_verify.c b/minires/ns_verify.c
index 7cf8a5f0..c1586eb6 100644
--- a/minires/ns_verify.c
+++ b/minires/ns_verify.c
@@ -22,11 +22,9 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_verify.c,v 1.7 2005/03/17 20:15:18 dhankins Exp $";
+static const char rcsid[] = "$Id: ns_verify.c,v 1.8 2007/08/22 13:41:37 shane Exp $";
#endif
-#define time(x) trace_mr_time (x)
-
/* Import. */
#include <sys/types.h>
@@ -44,6 +42,8 @@ static const char rcsid[] = "$Id: ns_verify.c,v 1.7 2005/03/17 20:15:18 dhankins
#include <unistd.h>
#include <time.h>
+#define time(x) trace_mr_time (x)
+
#include "minires/minires.h"
#include "arpa/nameser.h"
#include <isc-dhcp/dst.h>
diff --git a/omapip/array.c b/omapip/array.c
index 54aa056d..657e99a2 100644
--- a/omapip/array.c
+++ b/omapip/array.c
@@ -160,4 +160,3 @@ isc_result_t omapi_array_lookup (char **ptr, omapi_array_t *array, int index,
return ISC_R_NOTFOUND;
}
-OMAPI_ARRAY_TYPE_DECL(omapi_object, omapi_object_t);
diff --git a/omapip/connection.c b/omapip/connection.c
index 3f0965d2..618eaa75 100644
--- a/omapip/connection.c
+++ b/omapip/connection.c
@@ -173,8 +173,9 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
if (bind (obj -> socket, (struct sockaddr *)&local_sin,
sizeof local_sin) < 0) {
- omapi_object_dereference ((omapi_object_t **)
- &obj, MDL);
+ omapi_connection_object_t **objp = &obj;
+ omapi_object_t **o = (omapi_object_t **)objp;
+ omapi_object_dereference(o, MDL);
if (errno == EADDRINUSE)
return ISC_R_ADDRINUSE;
if (errno == EADDRNOTAVAIL)
diff --git a/omapip/mrtrace.c b/omapip/mrtrace.c
index ff80e4cd..838e304c 100644
--- a/omapip/mrtrace.c
+++ b/omapip/mrtrace.c
@@ -64,8 +64,6 @@ time_t trace_mr_time (time_t *);
int trace_mr_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
unsigned int trace_mr_res_randomid (unsigned int);
-extern time_t cur_time;
-
#if defined (TRACING)
void trace_mr_init ()
{
diff --git a/server/dhcpv6.c b/server/dhcpv6.c
index 4ae4014a..292e3092 100644
--- a/server/dhcpv6.c
+++ b/server/dhcpv6.c
@@ -1007,6 +1007,12 @@ lease_to_client(struct data_string *reply_ret,
ia_na = NULL;
lease = NULL;
+ /*
+ * Silence compiler warnings.
+ */
+ valid_lifetime = 0;
+ preferred_lifetime = 0;
+
/*
* Set up reply.
*/
@@ -2175,7 +2181,7 @@ iterate_over_ia_na(struct data_string *reply_ret,
struct packet *packet,
const struct data_string *client_id,
const struct data_string *server_id,
- char *packet_type,
+ const char *packet_type,
void (*ia_na_match)(),
void (*ia_na_nomatch)()) {
struct option_state *opt_state;