diff --git a/RELNOTES b/RELNOTES index 37ce554e..ac86d3dc 100644 --- a/RELNOTES +++ b/RELNOTES @@ -54,6 +54,14 @@ the README file. - An obviated option code hash lookup to find D6O_CLIENTID was removed. +- Corrected some situations where variables might be used without being + initialized. + +- Silenced several other compiler warnings. + +- Include the more standard sys/uio.h rather than rely upon other + header files to include it (fixes a BSDI compile failure). + Changes since 3.1.0 (NEW FEATURES) - DHCPv6 Client and Server protocol support. Use '-6' to run the daemons diff --git a/common/execute.c b/common/execute.c index efe31ff0..ce09d456 100644 --- a/common/execute.c +++ b/common/execute.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: execute.c,v 1.49 2007/01/28 23:00:19 each Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: execute.c,v 1.50 2007/05/11 15:50:18 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -796,7 +796,7 @@ void write_statements (file, statements, indent) indent_spaces (file, indent); fprintf (file, "}"); break; - + case case_statement: indent_spaces (file, indent - 1); fprintf (file, "case "); @@ -806,7 +806,7 @@ void write_statements (file, statements, indent) token_print_indent (file, col, indent + 5, "", "", ":"); break; - + case default_statement: indent_spaces (file, indent - 1); fprintf (file, "default: "); @@ -975,8 +975,8 @@ void write_statements (file, statements, indent) case execute_statement: #ifdef ENABLE_EXECUTE indent_spaces (file, indent); - col = token_print_indent(file, col, indent + 4, "", "", - "execute"); + col = token_print_indent(file, indent + 4, indent + 4, + "", "", "execute"); col = token_print_indent(file, col, indent + 4, " ", "", "("); col = token_print_indent(file, col, indent + 4, "\"", "\"", r->data.execute.command); diff --git a/common/options.c b/common/options.c index e192d9fd..171cfc0e 100644 --- a/common/options.c +++ b/common/options.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.106 2007/05/08 23:05:20 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.107 2007/05/11 15:50:18 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA @@ -177,12 +177,16 @@ int parse_option_buffer (options, buffer, length, universe) len = universe->get_length(buffer + offset); else if (universe->length_size == 0) len = length - universe->tag_size; - else + else { log_fatal("Improperly configured option space(%s): " "may not have a nonzero length size " "AND a NULL get_length function.", universe->name); + /* Silence compiler warnings. */ + return 0; + } + offset += universe->length_size; option_code_hash_lookup(&option, universe->code_hash, &code, @@ -1851,6 +1855,7 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) default: log_fatal("Impossible case at %s:%d.", MDL); + return ""; } for (i = 0; ;i++) { @@ -1865,7 +1870,7 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) break; enum_as_num: - sprintf(op, "%u", tval); + sprintf(op, "%lu", tval); break; case 'I': @@ -1889,11 +1894,11 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) if (tval == -1) sprintf (op, "%s", "infinite"); else - sprintf (op, "%ld", tval); + sprintf(op, "%lu", tval); break; case 'L': - sprintf (op, "%ld", - (unsigned long)getULong (dp)); + sprintf(op, "%lu", + (unsigned long)getULong(dp)); dp += 4; break; case 's': @@ -1901,7 +1906,7 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) dp += 2; break; case 'S': - sprintf (op, "%d", (unsigned)getUShort (dp)); + sprintf(op, "%u", (unsigned)getUShort(dp)); dp += 2; break; case 'b': diff --git a/common/parse.c b/common/parse.c index 10b37fac..5244ce9c 100644 --- a/common/parse.c +++ b/common/parse.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.121 2007/05/08 23:05:20 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.122 2007/05/11 15:50:18 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1562,7 +1562,7 @@ int parse_option_code_definition (cfile, option) encapsulated = NULL; if (!universe_hash_lookup(&encapsulated, universe_hash, val, strlen(val), MDL)) { - parse_warn(cfile, "unknown option space %s", s); + parse_warn(cfile, "unknown option space %s", val); skip_to_semi (cfile); return 0; } diff --git a/common/socket.c b/common/socket.c index 91ee49de..de322d41 100644 --- a/common/socket.c +++ b/common/socket.c @@ -42,11 +42,12 @@ #ifndef lint static char copyright[] = -"$Id: socket.c,v 1.60 2007/05/08 23:05:20 dhankins Exp $ " +"$Id: socket.c,v 1.61 2007/05/11 15:50:18 dhankins Exp $ " "Copyright (c) 2004-2006 Internet Systems Consortium.\n"; #endif /* not lint */ #include "dhcpd.h" +#include #ifdef USE_SOCKET_FALLBACK # if !defined (USE_SOCKET_SEND) diff --git a/includes/minires/minires.h b/includes/minires/minires.h index 67c55cc7..dc1f7549 100644 --- a/includes/minires/minires.h +++ b/includes/minires/minires.h @@ -50,6 +50,7 @@ int MRns_name_compress(const char *, u_char *, size_t, const unsigned char **, int MRns_name_unpack(const unsigned char *, const unsigned char *, const unsigned char *, unsigned char *, size_t); int MRns_name_ntop(const unsigned char *, char *, size_t); +int MRns_name_pton(const char *, u_char *, size_t); #if defined (MINIRES_LIB) #define res_update minires_update