diff --git a/ChangeLog b/ChangeLog index 185b1b951b..696a132818 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +979. [bug] fdupont + Fixed two cases of public variables in a base class being + hidden by variables in a derived class. + (Trac #3920, git xxx) + 978. [func] tmark DHCPv4, DHCPv6, and DHCP_DDNS now all create PID files upon startup. The PID file pathname is formed from: diff --git a/src/bin/d2/d_controller.cc b/src/bin/d2/d_controller.cc index 8aa18c77f9..2d6895f341 100644 --- a/src/bin/d2/d_controller.cc +++ b/src/bin/d2/d_controller.cc @@ -44,7 +44,7 @@ DControllerBase::DControllerBase(const char* app_name, const char* bin_name) : app_name_(app_name), bin_name_(bin_name), verbose_(false), spec_file_name_(""), io_service_(new isc::asiolink::IOService()), - signal_set_(), io_signal_queue_() { + io_signal_queue_() { } void diff --git a/src/bin/d2/d_controller.h b/src/bin/d2/d_controller.h index 19b42c65f4..593511d812 100644 --- a/src/bin/d2/d_controller.h +++ b/src/bin/d2/d_controller.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -506,9 +505,6 @@ private: /// @brief Shared pointer to an IOService object, used for ASIO operations. asiolink::IOServicePtr io_service_; - /// @brief Set of registered signals to handle. - util::SignalSetPtr signal_set_; - /// @brief Queue for propagating caught signals to the IOService. IOSignalQueuePtr io_signal_queue_; diff --git a/src/lib/dhcp/pkt.cc b/src/lib/dhcp/pkt.cc index 82e5319c39..dfd1f8aa33 100644 --- a/src/lib/dhcp/pkt.cc +++ b/src/lib/dhcp/pkt.cc @@ -48,8 +48,12 @@ Pkt::Pkt(const uint8_t* buf, uint32_t len, const isc::asiolink::IOAddress& local remote_port_(remote_port), buffer_out_(0) { - data_.resize(len); - if (len) { + + if (len != 0) { + if (buf == NULL) { + isc_throw(InvalidParameter, "data buffer passed to Pkt is NULL"); + } + data_.resize(len); memcpy(&data_[0], buf, len); } } diff --git a/src/lib/dhcp/pkt4.cc b/src/lib/dhcp/pkt4.cc index d88894463f..44a96ca53c 100644 --- a/src/lib/dhcp/pkt4.cc +++ b/src/lib/dhcp/pkt4.cc @@ -74,14 +74,7 @@ Pkt4::Pkt4(const uint8_t* data, size_t len) isc_throw(OutOfRange, "Truncated DHCPv4 packet (len=" << len << ") received, at least " << DHCPV4_PKT_HDR_LEN << " is expected."); - - } else if (data == NULL) { - isc_throw(InvalidParameter, "data buffer passed to Pkt4 is NULL"); } - - data_.resize(len); - memcpy(&data_[0], data, len); - memset(sname_, 0, MAX_SNAME_LEN); memset(file_, 0, MAX_FILE_LEN); } diff --git a/src/lib/dhcp/pkt4.h b/src/lib/dhcp/pkt4.h index 8441038285..549be78da8 100644 --- a/src/lib/dhcp/pkt4.h +++ b/src/lib/dhcp/pkt4.h @@ -366,24 +366,6 @@ public: /// (true) or non-relayed (false). bool isRelayed() const; - /// @brief That's the data of input buffer used in RX packet. - /// - /// @note Note that InputBuffer does not store the data itself, but just - /// expects that data will be valid for the whole life of InputBuffer. - /// Therefore we need to keep the data around. - /// - /// @warning This public member is accessed by derived - /// classes directly. One of such derived classes is - /// @ref perfdhcp::PerfPkt4. The impact on derived clasess' - /// behavior must be taken into consideration before making - /// changes to this member such as access scope restriction or - /// data format change etc. This field is also public, because - /// it may be modified by callouts (which are written in C++ now, - /// but we expect to also have them in Python, so any accesibility - /// methods would overly complicate things here and degrade - /// performance). - std::vector data_; - private: /// @brief Generic method that validates and sets HW address.