From: Marcin Siodelski Date: Wed, 23 Jul 2014 12:44:21 +0000 (+0200) Subject: [3320] Address review comments. X-Git-Tag: trac3482_base~73^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c584eade3ba9f25fc4028aede39570770eda5878;p=thirdparty%2Fkea.git [3320] Address review comments. --- diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index cd36b2a6f5..26535c5e87 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -147,7 +147,7 @@ point, the setting of the flag instructs the server not to choose a subnet, an action that severely limits further processing; the server will be only able to offer global options - no addresses will be assigned. -% DHCP4_INVALID_ADDRESS_INIT_REBOOT client having client-id %1, hwaddr %2 and being in the INIT-REBOOT state requested invalid address %3 +% DHCP4_INVALID_ADDRESS_INIT_REBOOT invalid address %1 requested by INIT-REBOOT client (id: %2, hwaddr: %3) This debug message is issued when the client being in the INIT-REBOOT state requested an address which is not assigned to him. The server will respond to this client with DHCPNAK. diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 122de028ff..c92795aaf4 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -976,9 +976,9 @@ Dhcpv4Srv::assignLease(const Pkt4Ptr& question, Pkt4Ptr& answer) { if (!lease) { LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_INVALID_ADDRESS_INIT_REBOOT) + .arg(hint.toText()) .arg(client_id ? client_id->toText():"(no client-id)") - .arg(hwaddr ? hwaddr->toText():"(no hwaddr info)") - .arg(hint.toText()); + .arg(hwaddr ? hwaddr->toText():"(no hwaddr info)"); answer->setType(DHCPNAK); answer->setYiaddr(IOAddress("0.0.0.0")); @@ -1111,7 +1111,7 @@ Dhcpv4Srv::assignLease(const Pkt4Ptr& question, Pkt4Ptr& answer) { } else { // Allocation engine did not allocate a lease. The engine logged - // cause of that failure. The onlxy thing left is to insert + // cause of that failure. The only thing left is to insert // status code to pass the sad news to the client. LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, fake_allocation? diff --git a/src/bin/dhcp4/tests/dhcp4_client.cc b/src/bin/dhcp4/tests/dhcp4_client.cc index 0d36ba4f55..987b98bf12 100644 --- a/src/bin/dhcp4/tests/dhcp4_client.cc +++ b/src/bin/dhcp4/tests/dhcp4_client.cc @@ -243,7 +243,11 @@ Dhcp4Client::doRequest() { void Dhcp4Client::includePRL() { - if (!requested_options_.empty() && context_.query_) { + if (!context_.query_) { + isc_throw(Dhcp4ClientError, "pointer to the query must not be NULL" + " when adding option codes to the PRL option"); + + } else if (!requested_options_.empty()) { // Include Parameter Request List if at least one option code // has been specified to be requested. OptionUint8ArrayPtr prl(new OptionUint8Array(Option::V4, diff --git a/src/bin/dhcp4/tests/dhcp4_client.h b/src/bin/dhcp4/tests/dhcp4_client.h index 0ba2762075..992271efb3 100644 --- a/src/bin/dhcp4/tests/dhcp4_client.h +++ b/src/bin/dhcp4/tests/dhcp4_client.h @@ -173,7 +173,7 @@ public: /// - SELECTING - client is trying to obtain a new lease and it has selected /// the server using the DHCPDISCOVER. /// - INIT-REBOOT - client cached an address it was previously using and is - /// now trying to verify if this addres is still valid. + /// now trying to verify if this address is still valid. /// - RENEW - client's renewal timer has passed and the client is trying to /// extend the lifetime of the lease. /// - REBIND - client's rebind timer has passed and the client is trying to @@ -296,7 +296,7 @@ public: private: - /// @brief Creates and addds Requested IP Address option to the client's + /// @brief Creates and adds Requested IP Address option to the client's /// query. /// /// @param addr Address to be added in the Requested IP Address option. @@ -324,9 +324,10 @@ private: /// @brief Include PRL Option in the query message. /// - /// This function creates the instance of the PRL option and adds - /// option codes from the @c requested_options_ to it. It later adds - /// the PRL option to the @c context_.query_ message if it is non-NULL. + /// This function creates the instance of the PRL (Parameter Request List) + /// option and adds option codes from the @c requested_options_ to it. + /// It later adds the PRL option to the @c context_.query_ message + /// if it is non-NULL. void includePRL(); /// @brief Simulates reception of the message from the server.