Commit 9d8d00f1 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[master] Merge branch 'trac5515a'

parents 54fea92d 7a727155
......@@ -2273,9 +2273,11 @@ Dhcpv4Srv::adjustIfaceData(Dhcpv4Exchange& ex) {
(cfg_iface->getSocketType() == CfgIface::SOCKET_UDP) &&
(cfg_iface->getOutboundIface() == CfgIface::USE_ROUTING)) {
// Mark the response to follow routing
response->setLocalAddr(IOAddress::IPV4_ZERO_ADDRESS());
response->setIface("");
response->resetIndex();
// But keep the interface name
response->setIface(query->getIface());
} else {
......@@ -2309,8 +2311,8 @@ Dhcpv4Srv::adjustIfaceData(Dhcpv4Exchange& ex) {
// may throw if for some reason the socket is closed.
/// @todo Consider an optimization that we use local address from
/// the query if this address is not broadcast.
response->setIface(query->getIface());
response->setIndex(query->getIndex());
response->setIface(query->getIface());
}
response->setLocalPort(DHCP4_SERVER_PORT);
......
......@@ -339,9 +339,11 @@ TEST_F(Dhcpv4SrvTest, adjustIfaceDataUseRouting) {
// No specific interface is selected as outbound interface and no specific
// local address is provided. The IfaceMgr will figure out which interface to use.
EXPECT_TRUE(resp->getLocalAddr().isV4Zero());
EXPECT_TRUE(resp->getIface().empty());
EXPECT_FALSE(resp->indexSet());
// Fixed in #5515 so now the interface name is never empty.
EXPECT_FALSE(resp->getIface().empty());
// Another test verifies that setting outbound interface to same as inbound will
// cause the server to set interface and local address as expected.
......
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