Commit 60606cab authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[2320] perfdhcp tests updated after Pkt4::setType() changed.

parent b8b0b9c2
......@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
#include <dhcp/libdhcp++.h>
#include <dhcp/dhcp6.h>
#include <dhcp/dhcp4.h>
#include "perf_pkt4.h"
......
......@@ -1284,6 +1284,10 @@ TestControl::sendDiscover4(const TestControlSocket& socket,
if (!pkt4) {
isc_throw(Unexpected, "failed to create DISCOVER packet");
}
// Delete the default Message Type option set by Pkt4
pkt4->delOption(DHO_DHCP_MESSAGE_TYPE);
// Set options: DHCP_MESSAGE_TYPE and DHCP_PARAMETER_REQUEST_LIST
OptionBuffer buf_msg_type;
buf_msg_type.push_back(DHCPDISCOVER);
......@@ -1371,11 +1375,7 @@ TestControl::sendRequest4(const TestControlSocket& socket,
const dhcp::Pkt4Ptr& offer_pkt4) {
const uint32_t transid = generateTransid();
Pkt4Ptr pkt4(new Pkt4(DHCPREQUEST, transid));
OptionBuffer buf_msg_type;
buf_msg_type.push_back(DHCPREQUEST);
OptionPtr opt_msg_type = Option::factory(Option::V4, DHO_DHCP_MESSAGE_TYPE,
buf_msg_type);
pkt4->addOption(opt_msg_type);
// Use first flags indicates that we want to use the server
// id captured in first packet.
if (CommandOptions::instance().isUseFirst() &&
......
......@@ -630,13 +630,10 @@ private:
boost::shared_ptr<Pkt4>
createOfferPkt4(uint32_t transid) const {
boost::shared_ptr<Pkt4> offer(new Pkt4(DHCPOFFER, transid));
OptionPtr opt_msg_type = Option::factory(Option::V4, DHO_DHCP_MESSAGE_TYPE,
OptionBuffer(DHCPOFFER));
OptionPtr opt_serverid = Option::factory(Option::V4,
DHO_DHCP_SERVER_IDENTIFIER,
OptionBuffer(4, 1));
offer->setYiaddr(asiolink::IOAddress("127.0.0.1"));
offer->addOption(opt_msg_type);
offer->addOption(opt_serverid);
offer->updateTimestamp();
return (offer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment