Commit 03effee3 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[1540] Leftover minor fixes from experiments/dhcp4 branch.

parent 65e86785
......@@ -574,12 +574,12 @@ IfaceMgr::send(boost::shared_ptr<Pkt6>& pkt) {
result = sendmsg(getSocket(*pkt), &m, 0);
if (result < 0) {
cout << "Send packet failed." << endl;
isc_throw(Unexpected, "Pkt6 send failed: sendmsg() returned " << result);
}
cout << "Sent " << pkt->data_len_ << " bytes over socket " << getSocket(*pkt)
<< " on " << iface->getFullName() << " interface: "
<< " dst=" << pkt->remote_addr_.toText()
<< ", src=" << pkt->local_addr_.toText()
<< " dst=[" << pkt->remote_addr_.toText() << "]:" << pkt->remote_port_
<< ", src=" << pkt->local_addr_.toText() << "]:" << pkt->remote_port_
<< endl;
return (result);
......@@ -1019,9 +1019,10 @@ IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) {
SocketCollection::const_iterator s;
for (s = iface->sockets_.begin(); s != iface->sockets_.end(); ++s) {
if (s->family_ != AF_INET) {
// don't use IPv4 sockets
// don't use IPv6 sockets
continue;
}
/// TODO: Add more checks here later. If remote address is
/// not link-local, we can't use link local bound socket
/// to send data.
......
......@@ -594,6 +594,8 @@ TEST(Pkt4Test, metaFields) {
EXPECT_EQ(42, pkt->getIndex());
EXPECT_EQ("1.2.3.4", pkt->getRemoteAddr().toText());
EXPECT_EQ("4.3.2.1", pkt->getLocalAddr().toText());
delete pkt;
}
} // end of anonymous namespace
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