]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Corrected some situations where variables might be used without being
authorDavid Hankins <dhankins@isc.org>
Fri, 11 May 2007 15:50:18 +0000 (15:50 +0000)
committerDavid Hankins <dhankins@isc.org>
Fri, 11 May 2007 15:50:18 +0000 (15:50 +0000)
  initialized. [ISC-Bugs #16865]

- Silenced several other compiler warnings. [ISC-Bugs #16865]

- Include the more standard sys/uio.h rather than rely upon other header
  files to include it (fixes a BSDI compile failure). [ISC-Bugs #16865]

RELNOTES
common/execute.c
common/options.c
common/parse.c
common/socket.c
includes/minires/minires.h

index 37ce554ecdc3ddaae4edd3b71364fb7a314a0cd8..ac86d3dcd192df6fad4718f5cf908f75977efd86 100644 (file)
--- 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
index efe31ff022c0c6ada167afab970088a92ef7c2e9..ce09d456b067632f25b32ca197ffbfd4bc2e1bd3 100644 (file)
@@ -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);
index e192d9fd6d5b6d0fb74da6f7635a48cb916d84c1..171cfc0e568818f495284cd26411754d2da013a3 100644 (file)
@@ -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 "<double impossible condition>";
                                }
 
                                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':
index 10b37fac500de3ea41581e12b424d47c36fa11f4..5244ce9c300c1ae5b8eda24bb0310afe1f881ef6 100644 (file)
@@ -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;
                }
index 91ee49deff38a4912d45368a543091375dca4887..de322d414395d3294ae5891c5a1e36a550967401 100644 (file)
 
 #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 <sys/uio.h>
 
 #ifdef USE_SOCKET_FALLBACK
 # if !defined (USE_SOCKET_SEND)
index 67c55cc726780eb93effd17111402570eeda7273..dc1f7549229d313a7f656037f65c3bc120939e7b 100644 (file)
@@ -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