<< "' 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.
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));
// 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.
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());