Custom routing fixes

This commit is contained in:
pokamest 2021-06-05 20:55:57 +03:00
parent c4235a60c8
commit dd959e7b26
8 changed files with 42 additions and 42 deletions

View file

@ -16,7 +16,7 @@ bool RouterMac::routeAdd(const QString &ipWithSubnet, const QString &gw)
QString ip = Utils::ipAddressFromIpWithSubnet(ipWithSubnet);
QString mask = Utils::netMaskFromIpWithSubnet(ipWithSubnet);
if (!Utils::checkIPFormat(ip) || !Utils::checkIPFormat(gw)) {
if (!Utils::checkIPv4Format(ip) || !Utils::checkIPv4Format(gw)) {
qCritical().noquote() << "Critical, trying to add invalid route: " << ip << gw;
return false;
}
@ -74,7 +74,7 @@ bool RouterMac::routeDelete(const QString &ipWithSubnet, const QString &gw)
QString ip = Utils::ipAddressFromIpWithSubnet(ipWithSubnet);
QString mask = Utils::netMaskFromIpWithSubnet(ipWithSubnet);
if (!Utils::checkIPFormat(ip) || !Utils::checkIPFormat(gw)) {
if (!Utils::checkIPv4Format(ip) || !Utils::checkIPv4Format(gw)) {
qCritical().noquote() << "Critical, trying to remove invalid route: " << ip << gw;
return false;
}