2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 05:27:55 +00:00

[#1151] fixed compilation warnings

This commit is contained in:
Razvan Becheriu 2020-03-31 23:42:10 +03:00
parent 9ba2eb490f
commit 94ac80f524
2 changed files with 4 additions and 9 deletions

View File

@ -197,8 +197,7 @@ PktFilterLPF::openSocket(Iface& iface,
<< "' to interface '" << iface.getName() << "'");
}
// Set socket to non-blocking mode. In theory it is useless but
// in real world the socket can block on read...
// Set socket to non-blocking mode.
if (fcntl(sock, F_SETFL, O_NONBLOCK) != 0) {
// Get the error message immediately after the bind because the
// invocation to close() below would override the errno.
@ -207,7 +206,7 @@ PktFilterLPF::openSocket(Iface& iface,
close(fallback);
isc_throw(SocketConfigError, "failed to set SO_NONBLOCK option on the"
" LPF socket '" << sock << "' to interface '"
<< iface.getName() << "'");
<< iface.getName() << "'" << ", reason: " << errmsg);
}
return (SocketInfo(addr, port, sock, fallback));

View File

@ -1129,9 +1129,7 @@ TEST_F(LibDhcpTest, option43Pad) {
// Parse options.
OptionCollection options;
list<uint16_t> deferred;
size_t offset = 0;
ASSERT_NO_THROW(offset = LibDHCP::unpackOptions4(buf, space,
options, deferred, true));
ASSERT_NO_THROW(LibDHCP::unpackOptions4(buf, space, options, deferred, true));
// There should be 2 suboptions (1 and 2) because no sub-option 0
// was defined so code 0 means PAD.
@ -1159,9 +1157,7 @@ TEST_F(LibDhcpTest, option43Pad) {
LibDHCP::commitRuntimeOptionDefs();
options.clear();
offset = 0;
ASSERT_NO_THROW(offset = LibDHCP::unpackOptions4(buf, space,
options, deferred, true));
ASSERT_NO_THROW(LibDHCP::unpackOptions4(buf, space, options, deferred, true));
// There should be 2 suboptions (0 and 1).
EXPECT_EQ(2, options.size());