2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-05 08:25:16 +00:00

[5442] Store network states in DHCPv4 and DHCPv6 servers.

This commit is contained in:
Marcin Siodelski
2017-12-01 17:13:11 +01:00
parent 218f7033a0
commit cff0cf5a8a
7 changed files with 53 additions and 17 deletions

View File

@@ -416,7 +416,7 @@ const std::string Dhcpv4Srv::VENDOR_CLASS_PREFIX("VENDOR_CLASS_");
Dhcpv4Srv::Dhcpv4Srv(uint16_t port, const bool use_bcast,
const bool direct_response_desired)
: io_service_(new IOService()), shutdown_(true), alloc_engine_(), port_(port),
use_bcast_(use_bcast) {
use_bcast_(use_bcast), network_state_(NetworkState::DHCPv4) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_OPEN_SOCKET).arg(port);
try {
@@ -804,7 +804,10 @@ Dhcpv4Srv::run_one() {
return;
}
processPacket(query, rsp);
// If the DHCP service has been globally disabled, drop the packet.
if (network_state_.isServiceEnabled()) {
processPacket(query, rsp);
}
if (!rsp) {
return;