]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Patch for 21093 - handle v4 or v6 only a little better. If we can't contstruct
authorShawn Routhier <sar@isc.org>
Tue, 25 May 2010 00:22:29 +0000 (00:22 +0000)
committerShawn Routhier <sar@isc.org>
Tue, 25 May 2010 00:22:29 +0000 (00:22 +0000)
the context log it and leave, if we can but then try and do a DDNS transaction
using the protocol we don't have log it and continue.

RELNOTES
common/dispatch.c
common/dns.c
omapip/isclib.c
omapip/test.c

index 36066f089f28666b44022d71eaa6f46dbd6541dd..b85a0e8f9476c7de7259758becfa020917f95de8 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -41,15 +41,21 @@ work on other platforms. Please report any problems and suggested fixes to
 
                        Changes since 4.2.0b1
 
-- Prohibit including lease time information in a response to a DHCP INFORM
-  Bug ticket 21092.
+- Prohibit including lease time information in a response to a DHCP INFORM.
+  [ISC-Bugs #21092]
 
 ! Accept a client id of length 0 while hashing.  Previously the server would
   exit if it attempted to hash a zero length client id, providing attackers
-  with a simple denial of service attack.  Bug ticket 21253.
+  with a simple denial of service attack.  [ISC-Bugs #21253]
 
 - A memory leak in ddns processing was closed.  [ISC-Bugs #21377]
 
+- Modify the exception handling for initial context creation.  Previously
+  we would try and clean up before exiting.  This could present problems
+  when the cleanup required part of the context that wasn't available.  It
+  also didn't do much as we exited afterwards anyway.   Now we simply log
+  the error and exit. [ISC-Bugs #21093]
+
                        Changes since 4.2.0a2
 
 - Update the fsync code to work with the changes to the DDNS code.  It now
@@ -58,7 +64,7 @@ work on other platforms. Please report any problems and suggested fixes to
 - When constructing the DNS name structure from a text string append
   the root to relative names.  This satisfies a requirement in the DNS
   library that names be absolute instead of relative and prevents DHCP
-  from crashing.  Bug ticket 21054.
+  from crashing.  [ISC-Bugs #21054]
 
 - "The LDAP Patch" that has been circulating for some time, written by
   Brian Masney and S.Kalyanasundraram and maintained for application to
index fef2249f39a3c79c1db4a44c150bdcb93aeb175d..27b59a9fb2f56083895c3cc57cd9ea3d442b190c 100644 (file)
@@ -3,7 +3,7 @@
    Network input dispatcher... */
 
 /*
- * Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -112,8 +112,6 @@ dispatch(void)
 
        status = isc_app_ctxrun(dhcp_gbl_ctx.actx);
 
-       isclib_cleanup();
-
        log_fatal ("Dispatch routine failed: %s -- exiting",
                   isc_result_totext (status));
 }
index 5c2e5b3311a650e4a07f2c023486228d7fb5c8fa..970d7cf9e321a1703fef2ef3502a38afe7f1c99b 100644 (file)
@@ -1464,6 +1464,10 @@ ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb)
                             ddns_interlude,
                             (void *)ddns_cb,
                             &ddns_cb->transaction);
+       if (result == ISC_R_FAMILYNOSUPPORT) {
+               log_info("Unable to perform DDNS update, "
+                        "address family not supported");
+       }
 
  cleanup:
        if (dataspace != NULL) {
@@ -1645,6 +1649,10 @@ ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb)
                             dhcp_gbl_ctx.task,
                             ddns_interlude, (void *)ddns_cb,
                             &ddns_cb->transaction);
+       if (result == ISC_R_FAMILYNOSUPPORT) {
+               log_info("Unable to perform DDNS update, "
+                        "address family not supported");
+       }
 
  cleanup:
        if (dataspace != NULL) {
index f44f331b6e83c89d2a1d6d3c4a38afe34f56272b..1534dde52b36116479f0fbffce7e90866237aa4f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2009 by Internet Systems Consortium, Inc.("ISC")
+ * Copyright(c) 2009-2010 by Internet Systems Consortium, Inc.("ISC")
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -40,7 +40,6 @@ isclib_cleanup(void)
 #endif
 
        if (dhcp_gbl_ctx.task != NULL) {
-//             isc_task_destroy(&dhcp_gbl_ctx.task);
                isc_task_shutdown(dhcp_gbl_ctx.task);
                isc_task_detach(&dhcp_gbl_ctx.task);
        }
@@ -152,7 +151,10 @@ dhcp_context_create(void) {
        return(ISC_R_SUCCESS);
 
  cleanup:
-       isclib_cleanup();
+       /*
+        * Currently we don't try and cleanup, just return an error
+        * expecting that our caller will log the error and exit.
+        */
 
        return(result);
 }
index 34017e09eadfed73efb734204898e6644ef6e005..1171317b989abcc4a2404975b85059edd877532c 100644 (file)
@@ -3,7 +3,8 @@
    Test code for omapip... */
 
 /*
- * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2010 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1999-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -50,7 +51,12 @@ int main (int argc, char **argv)
        omapi_object_t *connection = (omapi_object_t*)0;
        isc_result_t status;
 
-       dhcp_context_create();
+       status = dhcp_context_create();
+       if (status != ISC_R_SUCCESS) {
+               fprintf(stderr, "Can't initialize context: %s\n",
+                       isc_result_totext(status));
+               exit(1);
+       }
 
        omapi_init ();