diff --git a/src/lib/dhcp/pkt_filter_lpf.cc b/src/lib/dhcp/pkt_filter_lpf.cc index 0b57b21bb9..ca700c47cf 100644 --- a/src/lib/dhcp/pkt_filter_lpf.cc +++ b/src/lib/dhcp/pkt_filter_lpf.cc @@ -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)); diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc index 94648da699..95f0540de0 100644 --- a/src/lib/dhcp/tests/libdhcp++_unittest.cc +++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc @@ -1129,9 +1129,7 @@ TEST_F(LibDhcpTest, option43Pad) { // Parse options. OptionCollection options; list 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());