Skip to content

Commit 67f31db

Browse files
author
Razvan Becheriu
committed
[#3826] addressed review comments
1 parent 66a216e commit 67f31db

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2382. [build] razvan
1+
2382. [func] razvan
22
Implemented the 'lease6-get-by-hw-address' command used to query
33
IPv6 leases by HW Address.
44
(Gitlab #3826)

src/hooks/dhcp/lease_cmds/lease_cmds.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ LeaseCmdsImpl::leaseGetByHwAddressHandler(CalloutHandle& handle) {
15971597
isc_throw(BadValue, "'hw-address' parameter must be a string");
15981598
}
15991599

1600-
if (!v4 && hw_address->stringValue().empty()) {
1600+
if (hw_address->stringValue().empty()) {
16011601
isc_throw(BadValue, "'hw-address' parameter must not be empty");
16021602
}
16031603

src/hooks/dhcp/lease_cmds/libloadtests/lease_cmds4_unittest.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,17 @@ void Lease4CmdsTest::testLease4GetByHwAddressParams() {
17671767
exp_rsp = "'hw-address' parameter must be a string";
17681768
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
17691769

1770+
// Empty HWAddr.
1771+
cmd =
1772+
"{\n"
1773+
" \"command\": \"lease4-get-by-hw-address\",\n"
1774+
" \"arguments\": {"
1775+
" \"hw-address\": \"\"\n"
1776+
" }\n"
1777+
"}";
1778+
exp_rsp = "'hw-address' parameter must not be empty";
1779+
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
1780+
17701781
// Simply bad value.
17711782
cmd =
17721783
"{\n"
@@ -1795,15 +1806,6 @@ void Lease4CmdsTest::testLease4GetByHwAddressFind0() {
17951806
string exp_rsp = "0 IPv4 lease(s) found.";
17961807
testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
17971808

1798-
// Empty HWAddr.
1799-
cmd =
1800-
"{\n"
1801-
" \"command\": \"lease4-get-by-hw-address\",\n"
1802-
" \"arguments\": {"
1803-
" \"hw-address\": \"\"\n"
1804-
" }\n"
1805-
"}";
1806-
testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
18071809
}
18081810

18091811
void Lease4CmdsTest::testLease4GetByHwAddressFind2() {

0 commit comments

Comments
 (0)