You are not logged in.

1

Thursday, October 12th 2017, 6:42am

IPv4 address validation for bounds

I am using a text field to get ip address as user input and to validate I use
QHostAddress addr;
if(addr.setAddress(myQString){
if(QAbstractSocket::IPv4Protocol==addr.protocol()){
qDebug("Valid IPv4 address.");}
}
but for 123.999.999.999 it says is a valid address.
It just checks for the format. How can I check for bounds.