mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[#553] Updated after rebase
This commit is contained in:
@@ -511,6 +511,7 @@ Dhcp4Client::receiveOneMsg() {
|
|||||||
msg_copy->setRemotePort(msg->getLocalPort());
|
msg_copy->setRemotePort(msg->getLocalPort());
|
||||||
msg_copy->setLocalPort(msg->getRemotePort());
|
msg_copy->setLocalPort(msg->getRemotePort());
|
||||||
msg_copy->setIface(msg->getIface());
|
msg_copy->setIface(msg->getIface());
|
||||||
|
msg_copy->setIndex(msg->getIndex());
|
||||||
|
|
||||||
msg_copy->unpack();
|
msg_copy->unpack();
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
|
// Copyright (C) 2014-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
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
#include <dhcp/option6_iaaddr.h>
|
#include <dhcp/option6_iaaddr.h>
|
||||||
#include <dhcp/option6_status_code.h>
|
#include <dhcp/option6_status_code.h>
|
||||||
#include <dhcp/pkt6.h>
|
#include <dhcp/pkt6.h>
|
||||||
|
#include <dhcp/tests/iface_mgr_test_config.h>
|
||||||
#include <dhcpsrv/lease.h>
|
#include <dhcpsrv/lease.h>
|
||||||
#include <dhcpsrv/lease_mgr_factory.h>
|
#include <dhcpsrv/lease_mgr_factory.h>
|
||||||
#include <dhcpsrv/pool.h>
|
#include <dhcpsrv/pool.h>
|
||||||
@@ -103,6 +104,7 @@ Dhcp6Client::Dhcp6Client() :
|
|||||||
duid_(generateDUID(DUID::DUID_LLT)),
|
duid_(generateDUID(DUID::DUID_LLT)),
|
||||||
link_local_("fe80::3a60:77ff:fed5:cdef"),
|
link_local_("fe80::3a60:77ff:fed5:cdef"),
|
||||||
iface_name_("eth0"),
|
iface_name_("eth0"),
|
||||||
|
iface_index_(ETH0_INDEX),
|
||||||
srv_(boost::shared_ptr<NakedDhcpv6Srv>(new NakedDhcpv6Srv(0))),
|
srv_(boost::shared_ptr<NakedDhcpv6Srv>(new NakedDhcpv6Srv(0))),
|
||||||
use_relay_(false),
|
use_relay_(false),
|
||||||
use_oro_(false),
|
use_oro_(false),
|
||||||
@@ -121,6 +123,7 @@ Dhcp6Client::Dhcp6Client(boost::shared_ptr<NakedDhcpv6Srv>& srv) :
|
|||||||
duid_(generateDUID(DUID::DUID_LLT)),
|
duid_(generateDUID(DUID::DUID_LLT)),
|
||||||
link_local_("fe80::3a60:77ff:fed5:cdef"),
|
link_local_("fe80::3a60:77ff:fed5:cdef"),
|
||||||
iface_name_("eth0"),
|
iface_name_("eth0"),
|
||||||
|
iface_index_(ETH0_INDEX),
|
||||||
srv_(srv),
|
srv_(srv),
|
||||||
use_relay_(false),
|
use_relay_(false),
|
||||||
use_oro_(false),
|
use_oro_(false),
|
||||||
@@ -970,6 +973,7 @@ Dhcp6Client::sendMsg(const Pkt6Ptr& msg) {
|
|||||||
msg_copy->setRemoteAddr(link_local_);
|
msg_copy->setRemoteAddr(link_local_);
|
||||||
msg_copy->setLocalAddr(dest_addr_);
|
msg_copy->setLocalAddr(dest_addr_);
|
||||||
msg_copy->setIface(iface_name_);
|
msg_copy->setIface(iface_name_);
|
||||||
|
msg_copy->setIndex(iface_index_);
|
||||||
|
|
||||||
// Copy classes
|
// Copy classes
|
||||||
const ClientClasses& classes = msg->getClasses();
|
const ClientClasses& classes = msg->getClasses();
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
|
// Copyright (C) 2014-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
|
||||||
@@ -575,6 +575,13 @@ public:
|
|||||||
iface_name_ = iface_name;
|
iface_name_ = iface_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief Sets the interface to be used by the client.
|
||||||
|
///
|
||||||
|
/// @param iface_index Interface index.
|
||||||
|
void setIfaceIndex(uint32_t iface_index) {
|
||||||
|
iface_index_ = iface_index;
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief Sets link local address used by the client.
|
/// @brief Sets link local address used by the client.
|
||||||
///
|
///
|
||||||
/// @param link_local New link local address.
|
/// @param link_local New link local address.
|
||||||
@@ -912,9 +919,12 @@ private:
|
|||||||
/// @brief Currently used link local address.
|
/// @brief Currently used link local address.
|
||||||
asiolink::IOAddress link_local_;
|
asiolink::IOAddress link_local_;
|
||||||
|
|
||||||
/// @brief Currently used interface.
|
/// @brief Currently used interface (name).
|
||||||
std::string iface_name_;
|
std::string iface_name_;
|
||||||
|
|
||||||
|
/// @brief Currently used interface (index).
|
||||||
|
uint32_t iface_index_;
|
||||||
|
|
||||||
/// @brief Pointer to the server that the client is communicating with.
|
/// @brief Pointer to the server that the client is communicating with.
|
||||||
boost::shared_ptr<isc::dhcp::test::NakedDhcpv6Srv> srv_;
|
boost::shared_ptr<isc::dhcp::test::NakedDhcpv6Srv> srv_;
|
||||||
|
|
||||||
|
@@ -210,6 +210,7 @@ Dhcpv6SrvTest::createMessage(uint8_t message_type, Lease::Type lease_type,
|
|||||||
Pkt6Ptr msg = Pkt6Ptr(new Pkt6(message_type, 1234));
|
Pkt6Ptr msg = Pkt6Ptr(new Pkt6(message_type, 1234));
|
||||||
msg->setRemoteAddr(IOAddress("fe80::abcd"));
|
msg->setRemoteAddr(IOAddress("fe80::abcd"));
|
||||||
msg->setIface("eth0");
|
msg->setIface("eth0");
|
||||||
|
msg->setIndex(ETH0_INDEX);
|
||||||
msg->addOption(createIA(lease_type, addr, prefix_len, iaid));
|
msg->addOption(createIA(lease_type, addr, prefix_len, iaid));
|
||||||
return (msg);
|
return (msg);
|
||||||
}
|
}
|
||||||
@@ -338,6 +339,7 @@ Dhcpv6SrvTest::testRenewBasic(Lease::Type type,
|
|||||||
req.reset(new Pkt6(message_type, 1234));
|
req.reset(new Pkt6(message_type, 1234));
|
||||||
req->setRemoteAddr(IOAddress("fe80::abcd"));
|
req->setRemoteAddr(IOAddress("fe80::abcd"));
|
||||||
req->setIface("eth0");
|
req->setIface("eth0");
|
||||||
|
req->setIndex(ETH0_INDEX);
|
||||||
|
|
||||||
// from createIA
|
// from createIA
|
||||||
uint16_t code;
|
uint16_t code;
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include <dhcp/option_custom.h>
|
#include <dhcp/option_custom.h>
|
||||||
#include <dhcp/option.h>
|
#include <dhcp/option.h>
|
||||||
#include <dhcp/iface_mgr.h>
|
#include <dhcp/iface_mgr.h>
|
||||||
|
#include <dhcp/tests/iface_mgr_test_config.h>
|
||||||
#include <dhcpsrv/cfgmgr.h>
|
#include <dhcpsrv/cfgmgr.h>
|
||||||
#include <dhcpsrv/lease_mgr.h>
|
#include <dhcpsrv/lease_mgr.h>
|
||||||
#include <dhcpsrv/lease_mgr_factory.h>
|
#include <dhcpsrv/lease_mgr_factory.h>
|
||||||
|
Reference in New Issue
Block a user