Browse Source

Merge branch 'master' of ssh://git.kea.isc.org/git/kea

# Conflicts:
#	ChangeLog
Tomek Mrugalski 7 years ago
parent
commit
cce58fee4a

+ 12 - 1
ChangeLog

@@ -1,9 +1,20 @@
-1316.	[doc]		marcin
+1318.	[doc]		marcin
 	Updated Kea Administrator's Manual with the information about
 	new capability of flex-id hook library to use value derived from
 	flexible identifier as a client identifier or DUID.
 	(Trac #5384, git 91e1ff99b4dfb559733cf1189e927c0d98eae581)
 
+1317.	[bug]		fdupont
+	The kea-admin script now behaves properly when -4 or -6 is missing
+	while using lease-dump command.
+	(Trac #5379, git 53870c07d1864faf2a25bdc4ed6c5cf2b0223f8d)
+
+1316.	[bug]		marcin
+	Corrected a bug which caused a returning DHCPv4 client performing
+	4-way exchange to be assigned a different address from a shared
+	network than previously allocated.
+	(Trac #5388, git 601a387ba43d990947ee2e1a05e78851d8133a3c)
+
 1315.	[bug]		marcin
 	Created unit test for the case when there are several IPv6 subnets
 	within a shared network and each subnet specifies the same

+ 14 - 0
src/bin/admin/kea-admin.in

@@ -385,6 +385,13 @@ memfile_dump() {
 
 mysql_dump() {
 
+    # Check the lease type was given
+    if [ $dump_type -eq 0 ]; then
+        log_error "lease-dump: lease type ( -4 or -6 ) needs to be specified"
+        usage
+        exit 1
+    fi
+
     # get the correct dump query
     version=`mysql_version`
     retcode=$?
@@ -440,6 +447,13 @@ mysql_dump() {
 
 ### Functions used for dump
 pgsql_dump() {
+    # Check the lease type was given
+    if [ $dump_type -eq o ]; then
+        log_error "lease-dump: lease type ( -4 or -6 ) needs to be specified"
+        usage
+        exit 1
+    fi
+
     version=`pgsql_version`
     get_dump_query $version
 

+ 25 - 0
src/bin/dhcp4/tests/shared_network_unittest.cc

@@ -1062,6 +1062,31 @@ TEST_F(Dhcpv4SharedNetworkTest, poolInSharedNetworkShortage) {
     });
 }
 
+// Returning client sends 4-way exchange.
+TEST_F(Dhcpv4SharedNetworkTest, returningClientStartsOver) {
+    // Create client.
+    Dhcp4Client client(Dhcp4Client::SELECTING);
+    client.setIfaceName("eth1");
+    client.includeClientId("01:02:03:04");
+
+    // Configure the server with one shared network including two subnets and
+    // one subnet outside of the shared network.
+    configure(NETWORKS_CONFIG[0], *client.getServer());
+
+    // Client requests an address in first subnet within a shared network.
+    // We'll send a hint of 192.0.2.63 and expect to get it.
+    testAssigned([this, &client]() {
+        doDORA(client, "192.0.2.63", "192.0.2.63");
+    });
+
+
+    // The client reboots and performs 4-way exchange again without a hint.
+    // It should be assigned the same (existing) lease.
+    testAssigned([this, &client]() {
+        doDORA(client, "192.0.2.63");
+    });
+}
+
 // Shared network is selected based on giaddr value (relay specified
 // on shared network level)
 TEST_F(Dhcpv4SharedNetworkTest, sharedNetworkSelectedByRelay1) {

+ 4 - 0
src/lib/dhcpsrv/alloc_engine.cc

@@ -2443,6 +2443,10 @@ void findClientLease(AllocEngine::ClientContext4& ctx, Lease4Ptr& client_lease)
         // configured to ignore client identifier).
         if (client_id) {
             client_lease = lease_mgr.getLease4(*client_id, subnet->getID());
+            if (client_lease) {
+                ctx.subnet_ = subnet;
+                return;
+            }
         }
 
         // If no lease found using the client identifier, try the lookup using