From 3210786b6eb9d28df19bd2f5281f563b1c60b501 Mon Sep 17 00:00:00 2001 From: Thomas Markwalder Date: Tue, 4 Oct 2016 14:25:25 -0400 Subject: [master] Server now permits one UID to hold leases in multiple subnets Merges in rt41358. --- server/dhcp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/dhcp.c') diff --git a/server/dhcp.c b/server/dhcp.c index c9b36325..a490f635 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -4152,6 +4152,7 @@ int find_lease (struct lease **lp, * preference, so the first one is the best one. */ while (uid_lease) { + isc_boolean_t do_release = !packet->raw->ciaddr.s_addr; #if defined (DEBUG_FIND_LEASE) log_info ("trying next lease matching client id: %s", piaddr (uid_lease -> ip_addr)); @@ -4182,6 +4183,9 @@ int find_lease (struct lease **lp, log_info ("wrong network segment: %s", piaddr (uid_lease -> ip_addr)); #endif + /* Allow multiple leases using the same UID + on different subnetworks. */ + do_release = ISC_FALSE; goto n_uid; } @@ -4197,7 +4201,7 @@ int find_lease (struct lease **lp, if (uid_lease -> n_uid) lease_reference (&next, uid_lease -> n_uid, MDL); - if (!packet -> raw -> ciaddr.s_addr) + if (do_release) release_lease (uid_lease, packet); lease_dereference (&uid_lease, MDL); if (next) { -- cgit v1.2.1