From: Evan Hunt Date: Mon, 7 May 2007 17:19:17 +0000 (+0000) Subject: Fixed a bug that caused OMAPI clients to hang when opening leases. [rt16495] X-Git-Tag: v4_0_0a1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74dc3e0b2786c46956e7517398ae6f7c6dad52d7;p=thirdparty%2Fdhcp.git Fixed a bug that caused OMAPI clients to hang when opening leases. [rt16495] --- diff --git a/RELNOTES b/RELNOTES index 0c9842cbc..bcd9e4708 100644 --- a/RELNOTES +++ b/RELNOTES @@ -27,6 +27,9 @@ the README file. Changes since 3.1.0b1 +- Fixed a bug that caused OMAPI clients to freeze when opening lease + objects. + - A new server config option "fqdn-reply" specifies whether the server should send out option 81 (FQDN). Defaults to "on". If set to "off", the FQDN option is not sent, even if the client requested it. This is diff --git a/omapip/protocol.c b/omapip/protocol.c index f5bbb0c7c..281c1e4fa 100644 --- a/omapip/protocol.c +++ b/omapip/protocol.c @@ -34,7 +34,7 @@ #ifndef lint static char ocopyright[] = -"$Id: protocol.c,v 1.30 2006/02/24 23:16:30 dhankins Exp $ Copyright 2004-2006 Internet Systems Consortium."; +"$Id: protocol.c,v 1.31 2007/05/07 17:19:17 each Exp $ Copyright 2004-2006 Internet Systems Consortium."; #endif #include @@ -150,6 +150,10 @@ isc_result_t omapi_protocol_send_intro (omapi_object_t *h, return ISC_R_SUCCESS; } +#ifdef DEBUG_PROTOCOL +extern const char *omapi_message_op_name(int); +#endif /* DEBUG_PROTOCOL */ + isc_result_t omapi_protocol_send_message (omapi_object_t *po, omapi_object_t *id, omapi_object_t *mo, @@ -176,9 +180,9 @@ isc_result_t omapi_protocol_send_message (omapi_object_t *po, om = (omapi_message_object_t *)omo; #ifdef DEBUG_PROTOCOL - log_debug ("omapi_protocol_send_message()" - "op=%ld handle=%#lx id=%#lx rid=%#lx", - (long)m -> op, + log_debug ("omapi_protocol_send_message(): " + "op=%s handle=%#lx id=%#lx rid=%#lx", + omapi_message_op_name (m->op), (long)(m -> object ? m -> object -> handle : m -> handle), (long)p -> next_xid, (long)m -> rid); #endif diff --git a/server/omapi.c b/server/omapi.c index 4caf8e34d..af6b5b1d8 100644 --- a/server/omapi.c +++ b/server/omapi.c @@ -41,7 +41,7 @@ #ifndef lint static char copyright[] = -"$Id: omapi.c,v 1.59 2006/10/27 22:54:13 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: omapi.c,v 1.60 2007/05/07 17:19:17 each Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -701,10 +701,13 @@ isc_result_t dhcp_lease_stuff_values (omapi_object_t *c, return status; status = omapi_connection_put_name (c, "flags"); + if (status != ISC_R_SUCCESS) + return status; + status = omapi_connection_put_uint32(c, sizeof(flagbuf)); if (status != ISC_R_SUCCESS) return status; flagbuf = lease->flags & EPHEMERAL_FLAGS; - status = omapi_connection_copyin(c, &flagbuf, 1); + status = omapi_connection_copyin(c, &flagbuf, sizeof(flagbuf)); if (status != ISC_R_SUCCESS) return status;