diff options
author | Thomas Markwalder <tmark@isc.org> | 2016-11-01 14:21:18 -0400 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2016-11-01 14:21:18 -0400 |
commit | 351535b4e46492e8f42bff12862d10c858124b26 (patch) | |
tree | a011f07998b10b9133627c042d857ed77e4d8c6d /server | |
parent | 7f5461bd7e5ceef7790b0296ce227928492fce85 (diff) | |
download | isc-dhcp-351535b4e46492e8f42bff12862d10c858124b26.tar.gz |
[v4_3] DHCPINFORM response now includes options down to the pool scope
Merges in rt43219.
Diffstat (limited to 'server')
-rw-r--r-- | server/dhcp.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/server/dhcp.c b/server/dhcp.c index a490f635..af456580 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -1085,6 +1085,7 @@ void dhcpinform (packet, ms_nulltp) #if defined (DEBUG_INFORM_HOST) int h_w_fixed_addr = 0; #endif + struct lease* cip_lease = NULL; /* The client should set ciaddr to its IP address, but apparently it's common for clients not to do this, so we'll use their IP @@ -1231,11 +1232,23 @@ void dhcpinform (packet, ms_nulltp) maybe_return_agent_options(packet, options); - /* Execute statements in scope starting with the subnet scope. */ + /* If we have ciaddr, find its lease so we can find its pool. */ + if (zeroed_ciaddr == ISC_FALSE) { + find_lease_by_ip_addr (&cip_lease, cip, MDL); + } + + /* Execute statements starting at the pool scope if we can + * otherwise the subnet scope is a far as we can go. */ execute_statements_in_scope(NULL, packet, NULL, NULL, packet->options, options, - &global_scope, subnet->group, + &global_scope, + (cip_lease != NULL && + cip_lease->pool != NULL ? + cip_lease->pool->group : subnet->group), NULL, NULL); + if (cip_lease) { + lease_dereference (&cip_lease, MDL); + } /* Execute statements in the class scopes. */ for (i = packet->class_count; i > 0; i--) { |