Merge "dnsck: add -i option, for SO_BINDTODEVICE"
diff --git a/antirollback/antirollback.py b/antirollback/antirollback.py
index d6839d9..49da6b5 100644
--- a/antirollback/antirollback.py
+++ b/antirollback/antirollback.py
@@ -26,7 +26,7 @@
 antirollback [options...]
 --
 i,interval=   seconds between updates [28800]
-p,persist=    path to persistent file [/config/ar_clock]
+p,persist=    path to persistent file [/fiber/config/ar_clock]
 u,user=       setuid to this user to run
 """
 
diff --git a/cache_warming/cache_warming.py b/cache_warming/cache_warming.py
index 986bcd7..e98e6f8 100644
--- a/cache_warming/cache_warming.py
+++ b/cache_warming/cache_warming.py
@@ -23,7 +23,7 @@
 TOP_N = 50
 FETCH_INTERVAL = 60  # seconds
 UDP_SERVER_PATH = '/tmp/dns_query_log_socket'
-HOSTS_JSON_PATH = '/config/cache_warming_hosts.json'
+HOSTS_JSON_PATH = '/fiber/config/cache_warming_hosts.json'
 
 
 def save_hosts(log):
diff --git a/cmds/logos.c b/cmds/logos.c
index 57a6d02..b5304b1 100644
--- a/cmds/logos.c
+++ b/cmds/logos.c
@@ -484,7 +484,7 @@
       "W: SIGUSR1: rate limit disabled.";
   static uint8_t now_limited[] =
       "W: SIGUSR2: rate limit re-enabled.";
-  const char *disable_limits_file = "/config/disable-log-limits";
+  const char *disable_limits_file = "/fiber/config/disable-log-limits";
   uint8_t buf[MAX_LINE_LENGTH], *header;
   ssize_t used = 0, got, headerlen;
   int overlong = 0;
diff --git a/conman/connection_manager.py b/conman/connection_manager.py
index c74b960..b3e11e6 100755
--- a/conman/connection_manager.py
+++ b/conman/connection_manager.py
@@ -160,7 +160,10 @@
       self.logger.debug('Wifi client already started on %s GHz', self.band)
       return
 
-    if self._actually_start_client():
+    # /bin/wifi will return 0 if the config hasn't changed, even if it is not
+    # /currently associated, so we need to check self.client_up as well as
+    # /checking that /bin/wifi succeeded.
+    if self._actually_start_client() and self.client_up:
       self.wifi.status.connected_to_wlan = True
       self.logger.info('Started wifi client on %s GHz', self.band)
 
@@ -231,7 +234,7 @@
   def __init__(self,
                bridge_interface='br0',
                tmp_dir='/tmp/conman',
-               config_dir='/config/conman',
+               config_dir='/fiber/config/conman',
                moca_tmp_dir='/tmp/cwmp/monitoring/moca2',
                run_duration_s=1, interface_update_period=5,
                wifi_scan_period_s=120, wlan_retry_s=120, associate_wait_s=15,
diff --git a/conman/interface.py b/conman/interface.py
index 245ca27..fbef47e 100755
--- a/conman/interface.py
+++ b/conman/interface.py
@@ -82,7 +82,7 @@
     if 'default' not in self.current_routes():
       return False
 
-    cmd = [self.CONNECTION_CHECK, '-I', self.name]
+    cmd = ['timeout', '5', self.CONNECTION_CHECK, '-I', self.name]
     if check_acs:
       cmd.append('-a')
 
diff --git a/craftui/craftui.py b/craftui/craftui.py
index f726bf2..f77213c 100755
--- a/craftui/craftui.py
+++ b/craftui/craftui.py
@@ -562,7 +562,7 @@
     data['cpu_temperature'] = self.ReadFile(sim + '/tmp/gpio/cpu_temperature')
     data['peer_up'] = os.path.exists(sim + '/tmp/peer-up')
     data['cpss_ready'] = os.path.exists(sim + '/tmp/cpss_ready')
-    cs = '/config/settings/'
+    cs = '/fiber/config/settings/'
     data['craft_ipaddr'] = self.ReadFile(sim + cs + 'craft_ipaddr')
     data['link_ipaddr'] = self.ReadFile(sim + cs + 'local_ipaddr')
     data['peer_ipaddr'] = self.ReadFile(sim + cs + 'peer_ipaddr')
diff --git a/experiment.py b/experiment.py
index 1318974..384c02a 100644
--- a/experiment.py
+++ b/experiment.py
@@ -9,7 +9,7 @@
 logger = logging.getLogger(__name__)
 
 EXPERIMENTS_TMP_DIR = '/tmp/experiments'
-EXPERIMENTS_DIR = '/config/experiments'
+EXPERIMENTS_DIR = '/fiber/config/experiments'
 
 _experiment_warned = set()
 _experiment_enabled = set()
diff --git a/libexperiments/experiments.h b/libexperiments/experiments.h
index 1f086ba..8f4981b 100644
--- a/libexperiments/experiments.h
+++ b/libexperiments/experiments.h
@@ -11,7 +11,7 @@
 //
 // C++ example:
 // ====================================
-//   const char* kConfigFolderPath[] = "/config/experiments";
+//   const char* kConfigFolderPath[] = "/fiber/config/experiments";
 //   int64_t kMinTimeBetweenRefreshUs = 60 * 1000 * 1000;  // 60 secs
 //   e = new Experiments();
 //   if (!e->Initialize(kConfigFolderPath, kMinTimeBetweenRefreshUs,
@@ -27,7 +27,7 @@
 //
 // C example:
 // ===================================
-//   const char* kConfigFolderPath[] = "/config/experiments";
+//   const char* kConfigFolderPath[] = "/fiber/config/experiments";
 //   int64_t kMinTimeBetweenRefreshUs = 60 * 1000 * 1000;  // 60 secs
 //   if (!experiments_initialize(kConfigFolderPath, kMinTimeBetweenRefreshUs,
 //                               NULL);  // use default register function
diff --git a/signing/S99readallfiles b/signing/S99readallfiles
index 00838fa..0132288 100755
--- a/signing/S99readallfiles
+++ b/signing/S99readallfiles
@@ -28,7 +28,7 @@
   start)
     (
       if is-fiberjack; then
-        nice -n 19 readallfiles -q /config && clear_failure_count
+        nice -n 19 readallfiles -q /fiber/config && clear_failure_count
       else
         nice -n 19 readallfiles -q / && clear_failure_count
       fi
diff --git a/speedtest/config.cc b/speedtest/config.cc
index 41803eb..cff195c 100644
--- a/speedtest/config.cc
+++ b/speedtest/config.cc
@@ -38,7 +38,7 @@
   }
 
   http::Url config_url(options.region_url);
-  config_url.set_path("/config");
+  config_url.set_path("/fiber/config");
   if (options.verbose) {
     std::cout << "Loading config from " << config_url.url() << "\n";
   }
diff --git a/speedtest/region.cc b/speedtest/region.cc
index 7e9e05a..ecb1f51 100644
--- a/speedtest/region.cc
+++ b/speedtest/region.cc
@@ -71,7 +71,7 @@
   }
 
   http::Url config_url(options.global_url);
-  config_url.set_path("/config");
+  config_url.set_path("/fiber/config");
   if (options.verbose) {
     std::cout << "Loading regions from " << config_url.url() << "\n";
   }
diff --git a/taxonomy/dhcp.py b/taxonomy/dhcp.py
index e415126..3affcef 100644
--- a/taxonomy/dhcp.py
+++ b/taxonomy/dhcp.py
@@ -18,8 +18,8 @@
 """
 
 # Unit tests can override these.
-DHCP_LEASES_FILE = '/config/dhcp.leases'
-DHCP_SIGNATURE_FILE = '/config/dhcp.fingerprints'
+DHCP_LEASES_FILE = '/fiber/config/dhcp.leases'
+DHCP_SIGNATURE_FILE = '/fiber/config/dhcp.fingerprints'
 
 
 # There is an enormous database of DHCP fingerprints at fingerbank.org.
diff --git a/taxonomy/wtax b/taxonomy/wtax
index d49545d..ee765b9 100755
--- a/taxonomy/wtax
+++ b/taxonomy/wtax
@@ -15,7 +15,7 @@
     if contains "$leasemac" "$mac"; then
       echo "$name"
     fi
-  done </config/dhcp.leases
+  done </fiber/config/dhcp.leases
 }
 
 dhcpsig() {
@@ -24,7 +24,7 @@
     if contains "$leasemac" "$mac"; then
       echo "$sig"
     fi
-  done </config/dhcp.fingerprints
+  done </fiber/config/dhcp.fingerprints
 }
 
 stations24=""
diff --git a/waveguide/helpers.py b/waveguide/helpers.py
index 382504d..b9d3cad 100644
--- a/waveguide/helpers.py
+++ b/waveguide/helpers.py
@@ -133,7 +133,7 @@
       _experiment_warned.add(name)
       sys.stderr.write('Warning: experiment %r not registered\n' % name)
   else:
-    enabled = os.path.exists(os.path.join('/config/experiments',
+    enabled = os.path.exists(os.path.join('/fiber/config/experiments',
                                           name + '.active'))
     if enabled and name not in _experiment_enabled:
       _experiment_enabled.add(name)
diff --git a/wifi/persist.py b/wifi/persist.py
index 3290698..7b82b2e 100644
--- a/wifi/persist.py
+++ b/wifi/persist.py
@@ -9,7 +9,7 @@
 import utils
 
 # TODO(rofrankel):  Figure out the right way to delete old-style persisted
-# options (e.g. /config/wifi/hostapd.opts.5).
+# options (e.g. /fiber/config/wifi/hostapd.opts.5).
 
 
 def save_options(program, interface, argv, tmp=False):
diff --git a/wifi/utils.py b/wifi/utils.py
index 198bf16..3b2db84 100644
--- a/wifi/utils.py
+++ b/wifi/utils.py
@@ -15,7 +15,7 @@
 import unicodedata
 
 
-_CONFIG_DIR = '/config/wifi'
+_CONFIG_DIR = '/fiber/config/wifi'
 FILENAME_KIND = collections.namedtuple(
     'FilenameKind', ('options', 'config', 'pid', 'alive'))(
         options='opts', config='conf', pid='pid', alive='alive')
diff --git a/wifi/wifi.py b/wifi/wifi.py
index 19e2d13..42ed53c 100755
--- a/wifi/wifi.py
+++ b/wifi/wifi.py
@@ -1148,7 +1148,7 @@
       interface = iw.find_interface_from_band(opt.band, interface_type,
                                               opt.interface_suffix)
       if opt.persist:
-        # Save in /config.
+        # Save in /fiber/config.
         persist.save_options(program, interface, argv, False)
       # Save in /tmp.
       persist.save_options(program, interface, argv, True)