Skip to content

Commit 3b46489

Browse files
committed
add error for dhcp-release cmd with release-retry cfg set to zero
1 parent 141c7e7 commit 3b46489

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

code/bngblaster/src/bbl_dhcp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ bbl_dhcp_ctrl_action(int fd, uint32_t session_id, json_t *arguments, dhcp_ctrl_a
414414
bool keep_address = false;
415415
json_unpack(arguments, "{s:b}", "keep-address", &keep_address);
416416

417+
if(action == DHCP_ACTION_RELEASE && g_ctx->config.dhcp_release_retry == 0) {
418+
return bbl_ctrl_status(fd, "error", 400,
419+
"dhcp-release not possible with release-retry configuration set to 0");
420+
}
421+
417422
if(session_id) {
418423
session = bbl_session_get(session_id);
419424
if(session) {

0 commit comments

Comments
 (0)