]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1151] fixed compilation warnings
authorRazvan Becheriu <razvan@isc.org>
Tue, 31 Mar 2020 20:42:10 +0000 (23:42 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 31 Mar 2020 20:42:10 +0000 (23:42 +0300)
src/lib/dhcp/pkt_filter_lpf.cc
src/lib/dhcp/tests/libdhcp++_unittest.cc

index 0b57b21bb9e882a893bdfacd259c4452ffd11813..ca700c47cf8a0784384311f881c74357721d187e 100644 (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));
index 94648da6990b2418215492709e67900e7b3bf143..95f0540de08e8cb420d475a6651b63718491042d 100644 (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());