Ensure that the DBus DhcpLeaseUpdated events are generated.

This commit is contained in:
Simon Kelley
2012-04-24 15:25:18 +01:00
parent 6a69ab5ebd
commit dcffad2a86
2 changed files with 49 additions and 39 deletions

View File

@@ -96,6 +96,11 @@ version 2.61
Add --tftp-lowercase option. Thanks to Oliver Rath for the Add --tftp-lowercase option. Thanks to Oliver Rath for the
patch. patch.
Ensure that the DBus DhcpLeaseUpdated events are generated
when a lease goes through INIT_REBOOT state, even if the
dhcp-script is not in use. thanks to Antoaneta-Ecaterina
Ene for the patch.
version 2.60 version 2.60
Fix compilation problem in Mac OS X Lion. Thanks to Olaf Fix compilation problem in Mac OS X Lion. Thanks to Olaf

View File

@@ -1222,15 +1222,19 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
log_tags(tagif_netid, ntohl(mess->xid)); log_tags(tagif_netid, ntohl(mess->xid));
if (do_classes)
{
/* pick up INIT-REBOOT events. */
lease->flags |= LEASE_CHANGED;
#ifdef HAVE_SCRIPT #ifdef HAVE_SCRIPT
if (do_classes && daemon->lease_change_command) if (daemon->lease_change_command)
{ {
struct dhcp_netid *n; struct dhcp_netid *n;
if (mess->giaddr.s_addr) if (mess->giaddr.s_addr)
lease->giaddr = mess->giaddr; lease->giaddr = mess->giaddr;
lease->flags |= LEASE_CHANGED;
free(lease->extradata); free(lease->extradata);
lease->extradata = NULL; lease->extradata = NULL;
lease->extradata_size = lease->extradata_len = 0; lease->extradata_size = lease->extradata_len = 0;
@@ -1267,6 +1271,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
} }
} }
#endif #endif
}
if (!hostname_auth && (client_hostname = host_from_dns(mess->yiaddr))) if (!hostname_auth && (client_hostname = host_from_dns(mess->yiaddr)))
{ {