Skip to content

Commit 6eaecfd

Browse files
committed
Issue warning if --serverbindip given for a dual-protocol socket
1 parent 0d9fa72 commit 6eaecfd

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/socket.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,16 @@ void CSocket::Init ( const quint16 iNewPortNumber, const quint16 iNewQosNumber,
152152

153153
// FIXME: If binding a dual-protocol interface to a specific address, does it cease to be dual-protocol?
154154

155-
// TODO - ALLOW IPV6 ADDRESS
156-
// if ( !strServerBindIP.isEmpty() )
157-
//{
158-
// UdpSocketInAddr.sin_addr.s_addr = htonl ( QHostAddress ( strServerBindIP ).toIPv4Address() );
159-
//}
160-
// END TODO - ALLOW IPV6 ADDRESS
155+
// It is not possible to bind a dual-protocol socket to a specific address
156+
if ( !strServerBindIP.isEmpty() )
157+
{
158+
qWarning()
159+
<< "Option --serverbindip ignored: cannot be used on a dual-protocol IPv6/IPv4 socket. Please add --noipv6 to use IPv4 only.";
160+
}
161161

162162
bIPv6Available = true; // this is a reference to CClient::bIPv6Available or CServer::bIPv6Available
163163

164-
qInfo() << "IPv6 socket created";
164+
qInfo() << "IPv6/IPv4 dual-protocol socket created";
165165
}
166166
}
167167

0 commit comments

Comments
 (0)