Commit c7d8adb3 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[2784] Addressed review comments.

parent 2f3d1fe8
...@@ -592,21 +592,17 @@ TestControl::openSocket() const { ...@@ -592,21 +592,17 @@ TestControl::openSocket() const {
std::string localname = options.getLocalName(); std::string localname = options.getLocalName();
std::string servername = options.getServerName(); std::string servername = options.getServerName();
uint16_t port = options.getLocalPort(); uint16_t port = options.getLocalPort();
uint8_t family = AF_INET;
int sock = 0; int sock = 0;
if (options.getIpVersion() == 6) { uint8_t family = (options.getIpVersion() == 6) ? AF_NET6 : AF_INET;
family = AF_INET6;
}
IOAddress remoteaddr(servername); IOAddress remoteaddr(servername);
// check for mismatch between ip option and server // Check for mismatch between ip option and server
if (family != remoteaddr.getFamily()) if (family != remoteaddr.getFamily()) {
{
isc_throw(InvalidParameter, isc_throw(InvalidParameter,
"Values for Ip version: " << (unsigned int)options.getIpVersion() "Values for Ip version: " <<
<< " and Server:" << servername << " are mismatched."); static_cast<unsigned int>options.getIpVersion()
<< " and Server:" << servername << " are mismatched.");
} }
if (port == 0) { if (port == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment