2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 22:15:23 +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() << "'"); << "' to interface '" << iface.getName() << "'");
} }
// Set socket to non-blocking mode. In theory it is useless but // Set socket to non-blocking mode.
// in real world the socket can block on read...
if (fcntl(sock, F_SETFL, O_NONBLOCK) != 0) { if (fcntl(sock, F_SETFL, O_NONBLOCK) != 0) {
// Get the error message immediately after the bind because the // Get the error message immediately after the bind because the
// invocation to close() below would override the errno. // invocation to close() below would override the errno.
@@ -207,7 +206,7 @@ PktFilterLPF::openSocket(Iface& iface,
close(fallback); close(fallback);
isc_throw(SocketConfigError, "failed to set SO_NONBLOCK option on the" isc_throw(SocketConfigError, "failed to set SO_NONBLOCK option on the"
" LPF socket '" << sock << "' to interface '" " LPF socket '" << sock << "' to interface '"
<< iface.getName() << "'"); << iface.getName() << "'" << ", reason: " << errmsg);
} }
return (SocketInfo(addr, port, sock, fallback)); return (SocketInfo(addr, port, sock, fallback));

View File

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