From: Shawn Routhier Date: Tue, 25 May 2010 00:22:29 +0000 (+0000) Subject: Patch for 21093 - handle v4 or v6 only a little better. If we can't contstruct X-Git-Tag: v4_3_0a1~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d122accf9a2f5e7af71dd7c743720a27e10dc654;p=thirdparty%2Fdhcp.git Patch for 21093 - handle v4 or v6 only a little better. If we can't contstruct 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. --- diff --git a/RELNOTES b/RELNOTES index 36066f089..b85a0e8f9 100644 --- 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 diff --git a/common/dispatch.c b/common/dispatch.c index fef2249f3..27b59a9fb 100644 --- a/common/dispatch.c +++ b/common/dispatch.c @@ -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)); } diff --git a/common/dns.c b/common/dns.c index 5c2e5b331..970d7cf9e 100644 --- a/common/dns.c +++ b/common/dns.c @@ -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) { diff --git a/omapip/isclib.c b/omapip/isclib.c index f44f331b6..1534dde52 100644 --- a/omapip/isclib.c +++ b/omapip/isclib.c @@ -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); } diff --git a/omapip/test.c b/omapip/test.c index 34017e09e..1171317b9 100644 --- a/omapip/test.c +++ b/omapip/test.c @@ -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 ();