From: Ted Lemon Date: Tue, 15 Aug 2000 23:43:02 +0000 (+0000) Subject: - Do the commit using the newly-computed lease parameters, not the old X-Git-Tag: V3-BETA-2-PATCH-1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39ae5027471e57fdfac89779f0a5c4cfe6b78024;p=thirdparty%2Fdhcp.git - Do the commit using the newly-computed lease parameters, not the old parameters. --- diff --git a/server/dhcp.c b/server/dhcp.c index b6839b2df..345d032db 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.158 2000/08/12 00:45:40 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.159 2000/08/15 23:43:02 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1733,17 +1733,6 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) else lease -> flags &= ~MS_NULL_TERMINATION; - /* If there are statements to execute when the lease is - committed, execute them. */ - if (lease -> on_commit && (!offer || offer == DHCPACK)) { - execute_statements (packet, lease, packet -> options, - state -> options, &lease -> scope, - lease -> on_commit); - if (lease -> on_commit) - executable_statement_dereference (&lease -> on_commit, - MDL); - } - /* Save any bindings. */ if (lease -> scope) { binding_scope_reference (< -> scope, lease -> scope, MDL); @@ -1776,6 +1765,17 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) data_string_forget (&d1, MDL); } + /* If there are statements to execute when the lease is + committed, execute them. */ + if (lease -> on_commit && (!offer || offer == DHCPACK)) { + execute_statements (packet, lt, packet -> options, + state -> options, &lease -> scope, + lease -> on_commit); + if (lease -> on_commit) + executable_statement_dereference (&lease -> on_commit, + MDL); + } + /* Don't call supersede_lease on a mocked-up lease. */ if (lease -> flags & STATIC_LEASE) { /* Copy the hardware address into the static lease