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

svn at pcbsd.org svn at pcbsd.org
Sat Nov 3 22:53:35 PDT 2012


Author: kris
Date: 2012-11-04 05:53:35 +0000 (Sun, 04 Nov 2012)
New Revision: 20114

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

Do some fixing for network restarting, make sure to start DHCP on lagg0 devices
if need be.

Also, make EnableLagg understand wifi country codes




Modified: pcbsd/current/src-qt4/libpcbsd/netif.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/netif.cpp	2012-11-03 09:17:28 UTC (rev 20113)
+++ pcbsd/current/src-qt4/libpcbsd/netif.cpp	2012-11-04 05:53:35 UTC (rev 20114)
@@ -557,7 +557,7 @@
 void NetworkInterface::enableLagg(QString dev)
 {
   // Get the first wired device, we will enable lagg0 to use it
-  QString wiredDev, wifiParent, wifiConf, tmp;
+  QString wiredDev, wifiParent, wifiConf, tmp, newWifiConf;
   wiredDev = NetworkInterface::getFirstWiredDevice();
   wifiParent = NetworkInterface::getWifiParent(dev);
 
@@ -585,16 +585,36 @@
   Utils::setConfFileValue( "/etc/rc.conf", "ifconfig_" + wifiParent, "ifconfig_" + wifiParent + "=\"ether ${ifconfig_" + wifiParent + "##*ether }\"", 2);
   Utils::setConfFileValue( "/etc/rc.conf", "wlans_" + wifiParent, "wlans_" + wifiParent + "=\"" + dev + "\"", -1);
 
+  wifiConf = wifiConf.simplified();
 
   // Check if we have a WPA setting, and put it in the right device slot
   if ( wifiConf.indexOf("WPA") != -1 )
   {
-    Utils::setConfFileValue( "/etc/rc.conf", "ifconfig_" + dev, "ifconfig_" + dev + "=\"WPA\"", -1);
+    newWifiConf="WPA";
     wifiConf = wifiConf.replace("WPA", "");
-    wifiConf = wifiConf.simplified();
   }
 
+  // Check if we have a Country code setting, and put it in the right device slot
+  if ( wifiConf.indexOf("country ") != -1 )
+  {
+    tmp = wifiConf;
+    tmp.remove(0, tmp.lastIndexOf("country") + 8);
+    tmp = tmp.section(" ", 0,0);
+
+    newWifiConf+=" country " + tmp;
+    wifiConf = wifiConf.remove(wifiConf.indexOf("country"), wifiConf.indexOf("country") + 10 );
+  }
+
+
+  // Save the new wifi config line
+  newWifiConf = newWifiConf.simplified();
+  Utils::setConfFileValue( "/etc/rc.conf", "ifconfig_" + dev, "ifconfig_" + dev + "=\"" + newWifiConf + "\"", -1);
+
+  // Set the wired device to UP
+  Utils::setConfFileValue( "/etc/rc.conf", "ifconfig_" + wiredDev, "ifconfig_" + wiredDev + "=\"UP\"", -1);
+
   // Enable the lagg0 interface
+  wifiConf = wifiConf.simplified();
   Utils::setConfFileValue( "/etc/rc.conf", "cloned_interfaces", "cloned_interfaces=\"lagg0\"", -1);
   Utils::setConfFileValue( "/etc/rc.conf", "ifconfig_lagg0", "ifconfig_lagg0=\"laggproto failover laggport " + wiredDev + " laggport " + dev + " " + wifiConf + "\"", -1);
 

Modified: pcbsd/current/src-qt4/libpcbsd/utils.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-11-03 09:17:28 UTC (rev 20113)
+++ pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-11-04 05:53:35 UTC (rev 20114)
@@ -645,7 +645,6 @@
        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



More information about the Commits mailing list