Browse Source

[master] Finished merge of trac3920 (data_ defined twice)

Francis Dupont 9 years ago
parent
commit
bd42a66fb6
6 changed files with 12 additions and 32 deletions
  1. 5 0
      ChangeLog
  2. 1 1
      src/bin/d2/d_controller.cc
  3. 0 4
      src/bin/d2/d_controller.h
  4. 6 2
      src/lib/dhcp/pkt.cc
  5. 0 7
      src/lib/dhcp/pkt4.cc
  6. 0 18
      src/lib/dhcp/pkt4.h

+ 5 - 0
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:

+ 1 - 1
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

+ 0 - 4
src/bin/d2/d_controller.h

@@ -23,7 +23,6 @@
 #include <dhcpsrv/daemon.h>
 #include <exceptions/exceptions.h>
 #include <log/logger_support.h>
-#include <util/signal_set.h>
 
 #include <boost/shared_ptr.hpp>
 #include <boost/noncopyable.hpp>
@@ -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_;
 

+ 6 - 2
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);
     }
 }

+ 0 - 7
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);
 }

+ 0 - 18
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<uint8_t> data_;
-
 private:
 
     /// @brief Generic method that validates and sets HW address.