[PC-BSD Commits] r17452 - pcbsd/current/src-qt4/libpcbsd

svn at pcbsd.org svn at pcbsd.org
Tue Jun 26 08:12:36 PDT 2012


Author: kris
Date: 2012-06-26 15:12:34 +0000 (Tue, 26 Jun 2012)
New Revision: 17452

Modified:
   pcbsd/current/src-qt4/libpcbsd/netif.cpp
   pcbsd/current/src-qt4/libpcbsd/utils.cpp
Log:

Fix two bugs

* When doing wifiQuickConnect, use better way to restart network, fixing issue with newly created wlan devices

* Make sure when we restart the network that dhclient gets kicked off on any devices that need it



Modified: pcbsd/current/src-qt4/libpcbsd/netif.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/netif.cpp	2012-06-26 14:44:16 UTC (rev 17451)
+++ pcbsd/current/src-qt4/libpcbsd/netif.cpp	2012-06-26 15:12:34 UTC (rev 17452)
@@ -473,7 +473,7 @@
        fileout.close();
      } 
 
-    restart(); //restart the network
+    Utils::restartNetworking();
    
    return;
 }

Modified: pcbsd/current/src-qt4/libpcbsd/utils.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-06-26 14:44:16 UTC (rev 17451)
+++ pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-06-26 15:12:34 UTC (rev 17452)
@@ -41,6 +41,7 @@
 #include <QLineEdit>
 #include <QPushButton>
 
+#include "pcbsd-netif.h"
 #include "pcbsd-utils.h"
 #include "dialogInfoBox.h"
 #include "dialogMetaProgress.h"
@@ -622,6 +623,38 @@
      }
    }
 
+   // Check for any devices to run DHCP on
+   QStringList ifs = NetworkInterface::getInterfaces();
+   for ( QStringList::Iterator it = ifs.begin(); it != ifs.end(); ++it )
+   {
+       QString dev = *it;
+
+       // Devices we can safely skip
+       if (dev.indexOf("lo") == 0 
+           || dev.indexOf("fwe") == 0 
+           || dev.indexOf("ipfw") == 0
+           || dev.indexOf("lagg") == 0
+           || dev.indexOf("plip") == 0
+           || dev.indexOf("pfsync") == 0
+           || dev.indexOf("pflog") == 0
+           || dev.indexOf("usbus") == 0
+           || dev.indexOf("vboxnet") == 0
+           || dev.indexOf("tun") == 0)
+	  continue;
+
+	// Check if this device has DHCP enabled
+	if ( Utils::getConfFileValue( "/etc/rc.conf", "ifconfig_" + dev + "=", 1 ).indexOf("DHCP") != -1 )
+	{
+	   qDebug() << "Running DHCP on " << dev;
+           infoBox.setInformativeText(QObject::tr("Running DHCP..."));
+     	   cmd.start(QString("/etc/rc.d/dhclient"), QStringList() << "start" << dev );
+           while ( cmd.state() != QProcess::NotRunning ) {
+             cmd.waitForFinished(100);
+             QCoreApplication::processEvents();
+           }
+	}
+   }
+
    infoBox.close();
 }
 



More information about the Commits mailing list