From: Marcin Siodelski Date: Thu, 24 Jul 2014 16:10:31 +0000 (+0200) Subject: [3269] Address issues raised in the second review. X-Git-Tag: trac3482_base~71^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=080ee7eec8b6b71912af75de8f88914a5d95512e;p=thirdparty%2Fkea.git [3269] Address issues raised in the second review. --- diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index c0566466ca..e57faf21f6 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -2351,7 +2351,6 @@ Dhcpv6Srv::processConfirm(const Pkt6Ptr& confirm) { // in IA_NA, mark it verified and verify that it belongs to the // subnet. if (iaaddr) { - verified = true; // If at least one address is not in range, then return // the NotOnLink status code. if (subnet && !subnet->inRange(iaaddr->getAddress())) { @@ -2362,9 +2361,10 @@ Dhcpv6Srv::processConfirm(const Pkt6Ptr& confirm) { status_msg.str())); return (reply); } + verified = true; } else { isc_throw(Unexpected, "failed to cast the IA Address option" - " to the Option6IAAddrPtr. This is programmatic" + " to the Option6IAAddrPtr. This is programming" " error and should be reported"); } } diff --git a/src/bin/dhcp6/tests/confirm_unittest.cc b/src/bin/dhcp6/tests/confirm_unittest.cc index 64d66cb0a8..b436144bff 100644 --- a/src/bin/dhcp6/tests/confirm_unittest.cc +++ b/src/bin/dhcp6/tests/confirm_unittest.cc @@ -297,7 +297,7 @@ TEST_F(ConfirmTest, relayedUnicast) { ASSERT_GT(client.getLeaseNum(), 0); client.setDestAddress(IOAddress("2001:db8:1::1")); // Send Confirm message to the server. - ASSERT_NO_THROW (client.doConfirm()); + ASSERT_NO_THROW(client.doConfirm()); // Client should have received a response. ASSERT_TRUE(client.getContext().response_); // Client should have received a status code option and this option should