"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/bin/dhcp4/dhcp4_srv.cc" between
kea-1.6.1.tar.gz and kea-1.6.2.tar.gz

About: Kea is a modern DHCPv4 & DHCPv6 Server (potential successor of ISC DHCP).

dhcp4_srv.cc  (kea-1.6.1):dhcp4_srv.cc  (kea-1.6.2)
// Copyright (C) 2011-2019 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2011-2020 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h> #include <config.h>
#include <kea_version.h> #include <kea_version.h>
#include <dhcp/dhcp4.h> #include <dhcp/dhcp4.h>
#include <dhcp/duid.h> #include <dhcp/duid.h>
skipping to change at line 245 skipping to change at line 245
resp_.reset(new Pkt4o6(resp_, resp6)); resp_.reset(new Pkt4o6(resp_, resp6));
} }
void void
Dhcpv4Exchange::copyDefaultFields() { Dhcpv4Exchange::copyDefaultFields() {
resp_->setIface(query_->getIface()); resp_->setIface(query_->getIface());
resp_->setIndex(query_->getIndex()); resp_->setIndex(query_->getIndex());
// explicitly set this to 0 // explicitly set this to 0
resp_->setSiaddr(IOAddress::IPV4_ZERO_ADDRESS()); resp_->setSiaddr(IOAddress::IPV4_ZERO_ADDRESS());
// ciaddr is always 0, except for the Renew/Rebind state when it may // ciaddr is always 0, except for the Renew/Rebind state and for
// be set to the ciaddr sent by the client. // Inform when it may be set to the ciaddr sent by the client.
resp_->setCiaddr(IOAddress::IPV4_ZERO_ADDRESS()); if (query_->getType() == DHCPINFORM) {
resp_->setCiaddr(query_->getCiaddr());
} else {
resp_->setCiaddr(IOAddress::IPV4_ZERO_ADDRESS());
}
resp_->setHops(query_->getHops()); resp_->setHops(query_->getHops());
// copy MAC address // copy MAC address
resp_->setHWAddr(query_->getHWAddr()); resp_->setHWAddr(query_->getHWAddr());
// relay address // relay address
resp_->setGiaddr(query_->getGiaddr()); resp_->setGiaddr(query_->getGiaddr());
// If src/dest HW addresses are used by the packet filtering class // If src/dest HW addresses are used by the packet filtering class
// we need to copy them as well. There is a need to check that the // we need to copy them as well. There is a need to check that the
skipping to change at line 3529 skipping to change at line 3533
def = LibDHCP::getLastResortOptionDef(DHCP4_OPTION_SPACE, code); def = LibDHCP::getLastResortOptionDef(DHCP4_OPTION_SPACE, code);
} }
// If not defined go to the next option // If not defined go to the next option
if (!def) { if (!def) {
continue; continue;
} }
// Get the existing option for its content and remove all // Get the existing option for its content and remove all
OptionPtr opt = query->getOption(code); OptionPtr opt = query->getOption(code);
if (!opt) { if (!opt) {
// should not happen but do not crash anyway // should not happen but do not crash anyway
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_DEFERRED_OPTION_MISSING)
.arg(code);
continue; continue;
} }
const OptionBuffer buf = opt->getData(); const OptionBuffer buf = opt->getData();
try {
// Unpack the option
opt = def->optionFactory(Option::V4, code, buf);
} catch (const std::exception& e) {
// Failed to parse the option.
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_DEFERRED_OPTION_UNPACK_FAIL)
.arg(code)
.arg(e.what());
continue;
}
while (query->delOption(code)) { while (query->delOption(code)) {
// continue // continue
} }
// Unpack the option and add it // Add the unpacked option.
opt = def->optionFactory(Option::V4, code, buf.cbegin(), buf.cend());
query->addOption(opt); query->addOption(opt);
} }
} }
void void
Dhcpv4Srv::startD2() { Dhcpv4Srv::startD2() {
D2ClientMgr& d2_mgr = CfgMgr::instance().getD2ClientMgr(); D2ClientMgr& d2_mgr = CfgMgr::instance().getD2ClientMgr();
if (d2_mgr.ddnsEnabled()) { if (d2_mgr.ddnsEnabled()) {
// Updates are enabled, so lets start the sender, passing in // Updates are enabled, so lets start the sender, passing in
// our error handler. // our error handler.
 End of changes. 5 change blocks. 
6 lines changed or deleted 23 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)