]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3269] Include client id in the server's response to Confirm.
authorMarcin Siodelski <marcin@isc.org>
Fri, 18 Jul 2014 17:20:41 +0000 (19:20 +0200)
committerMarcin Siodelski <marcin@isc.org>
Fri, 18 Jul 2014 17:20:41 +0000 (19:20 +0200)
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/confirm_unittest.cc

index 6272c3968be20806ad1162058d0914f6260ce7ac..52dffb87be715791c17633de0922b17a67df5589 100644 (file)
@@ -2323,7 +2323,8 @@ Dhcpv6Srv::processConfirm(const Pkt6Ptr& confirm) {
 
     // The server sends Reply message in response to Confirm.
     Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, confirm->getTransid()));
-    // Append necessary options. e.g. server id.
+    // Make sure that the necessary options are included.
+    copyDefaultOptions(confirm, reply);
     appendDefaultOptions(confirm, reply);
     // Number of addresses verified. If at the end it occurs that no addresses
     // were verified we will need to dicard the message.
index 49fdfe18bdf3e83560c8b01d3a5086a0ba6692d9..9a806310832700a10a73dff9b4d5804afada7915 100644 (file)
@@ -164,9 +164,9 @@ TEST_F(ConfirmTest, directClientDifferentIAID) {
     // indicate the success.
     ASSERT_TRUE(client.receivedStatusCode());
     ASSERT_EQ(STATUS_Success, client.getStatusCode());
-    // Make sure that the server id has been included.
+    // Make sure that the server id and client id have been included.
     EXPECT_TRUE(client.getContext().response_->getOption(D6O_SERVERID));
-
+    EXPECT_TRUE(client.getContext().response_->getOption(D6O_CLIENTID));
 
     ASSERT_EQ(2, client.getLeaseNum());
     lease_client2 = client.getLease(1);
@@ -178,8 +178,9 @@ TEST_F(ConfirmTest, directClientDifferentIAID) {
     ASSERT_NO_THROW(client.doConfirm());
     ASSERT_TRUE(client.receivedStatusCode());
     ASSERT_EQ(STATUS_NotOnLink, client.getStatusCode());
-    // Make sure that the server id has been included.
+    // Make sure that the server id have been included.
     EXPECT_TRUE(client.getContext().response_->getOption(D6O_SERVERID));
+    EXPECT_TRUE(client.getContext().response_->getOption(D6O_CLIENTID));
 }
 
 
@@ -220,8 +221,9 @@ TEST_F(ConfirmTest, relayedClient) {
     ASSERT_NO_THROW(client.doConfirm());
     ASSERT_TRUE(client.receivedStatusCode());
     ASSERT_EQ(STATUS_NotOnLink, client.getStatusCode());
-    // Make sure that the server id has been included.
+    // Make sure that the server id and client id have been included.
     EXPECT_TRUE(client.getContext().response_->getOption(D6O_SERVERID));
+    EXPECT_TRUE(client.getContext().response_->getOption(D6O_CLIENTID));
 }
 
 // Test that the Confirm message without any addresses is discarded.
@@ -261,8 +263,9 @@ TEST_F(ConfirmTest, relayedUnicast) {
     // indicate the success.
     ASSERT_TRUE(client.receivedStatusCode());
     ASSERT_EQ(STATUS_Success, client.getStatusCode());
-    // Make sure that the server id has been included.
+    // Make sure that the server id and client id have been included.
     EXPECT_TRUE(client.getContext().response_->getOption(D6O_SERVERID));
+    EXPECT_TRUE(client.getContext().response_->getOption(D6O_CLIENTID));
 }
 
 // This test checks that the Confirm message is discarded by the server if it