From: Ted Lemon Date: Thu, 25 Jan 2001 08:36:36 +0000 (+0000) Subject: - Fix a core dump pointed out by Albert Herranz. X-Git-Tag: V3-BETA-2-PATCH-15~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fb139d337e59b55bfd512a3409e830b7d675df3;p=thirdparty%2Fdhcp.git - Fix a core dump pointed out by Albert Herranz. - Fix handling of agent options. --- diff --git a/server/mdb.c b/server/mdb.c index 07f50592d..e076e47b2 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: mdb.c,v 1.50 2001/01/19 11:10:32 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: mdb.c,v 1.51 2001/01/25 08:36:36 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -878,18 +878,18 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate) } if (comp -> agent_options) - option_cache_dereference (&comp -> agent_options, MDL); + option_chain_head_dereference (&comp -> agent_options, MDL); if (lease -> agent_options) { /* Only retain the agent options if the lease is still affirmatively associated with a client. */ - if (lease -> binding_state == FTS_ACTIVE || - lease -> binding_state == FTS_EXPIRED || - lease -> binding_state == FTS_ABANDONED || - lease -> binding_state == FTS_RESERVED || - lease -> binding_state == FTS_BOOTP) - option_cache_reference (&comp -> agent_options, - lease -> agent_options, MDL); - option_cache_dereference (&lease -> agent_options, MDL); + if (lease -> next_binding_state == FTS_ACTIVE || + lease -> next_binding_state == FTS_EXPIRED || + lease -> next_binding_state == FTS_RESERVED || + lease -> next_binding_state == FTS_BOOTP) + option_chain_head_reference (&comp -> agent_options, + lease -> agent_options, + MDL); + option_chain_head_dereference (&lease -> agent_options, MDL); } /* Record the hostname information in the lease. */ @@ -947,7 +947,7 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate) just_move_it: if (!comp -> pool) { log_error ("Supersede_lease: lease %s with no pool.", - piaddr (lease -> ip_addr)); + piaddr (comp -> ip_addr)); return 0; } @@ -1206,8 +1206,8 @@ int lease_copy (struct lease **lp, if (lease -> scope) binding_scope_reference (< -> scope, lease -> scope, MDL); if (lease -> agent_options) - option_cache_reference (< -> agent_options, - lease -> agent_options, MDL); + option_chain_head_reference (< -> agent_options, + lease -> agent_options, MDL); host_reference (< -> host, lease -> host, file, line); subnet_reference (< -> subnet, lease -> subnet, file, line); pool_reference (< -> pool, lease -> pool, file, line);