Macos route delete fix
This commit is contained in:
parent
85b6b06cc9
commit
f9affb083b
3 changed files with 4 additions and 4 deletions
|
@ -39,7 +39,7 @@ bool Router::routeDelete(const QString &ip, const QString &gw)
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
return RouterWin::Instance().routeDelete(ip, gw);
|
return RouterWin::Instance().routeDelete(ip, gw);
|
||||||
#elif defined (Q_OS_MAC)
|
#elif defined (Q_OS_MAC)
|
||||||
return RouterMac::Instance().routeDelete(ip);
|
return RouterMac::Instance().routeDelete(ip, gw);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,13 @@ bool RouterMac::clearSavedRoutes()
|
||||||
// return (cnt == m_addedRoutes.count());
|
// return (cnt == m_addedRoutes.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RouterMac::routeDelete(const QString &ip)
|
bool RouterMac::routeDelete(const QString &ip, const QString &gw)
|
||||||
{
|
{
|
||||||
// route delete ip gw
|
// route delete ip gw
|
||||||
QProcess p;
|
QProcess p;
|
||||||
p.setProcessChannelMode(QProcess::MergedChannels);
|
p.setProcessChannelMode(QProcess::MergedChannels);
|
||||||
|
|
||||||
p.start("route", QStringList() << "delete" << ip);
|
p.start("route", QStringList() << "delete" << ip << gw);
|
||||||
p.waitForFinished();
|
p.waitForFinished();
|
||||||
qDebug().noquote() << "OUTPUT routeDelete: " + p.readAll();
|
qDebug().noquote() << "OUTPUT routeDelete: " + p.readAll();
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
bool routeAdd(const QString &ip, const QString &gw, QString mask = QString());
|
bool routeAdd(const QString &ip, const QString &gw, QString mask = QString());
|
||||||
int routeAddList(const QString &gw, const QStringList &ips);
|
int routeAddList(const QString &gw, const QStringList &ips);
|
||||||
bool clearSavedRoutes();
|
bool clearSavedRoutes();
|
||||||
bool routeDelete(const QString &ip);
|
bool routeDelete(const QString &ip, const QString &gw);
|
||||||
void flushDns();
|
void flushDns();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue