svc/conntrack.in: Hoist `netupdown' above `kickpeers'.
[tripe] / svc / conntrack.in
index 3368295..1ccbae6 100644 (file)
@@ -237,6 +237,16 @@ def localaddr(peer):
     sk.close()
 
 _kick = T.Queue()
+
+def netupdown(upness, reason):
+  """
+  Add or kill peers according to whether the network is up or down.
+
+  UPNESS is true if the network is up, or false if it's down.
+  """
+
+  _kick.put((upness, reason))
+
 def kickpeers():
   while True:
     upness, reason = _kick.get()
@@ -332,15 +342,6 @@ def kickpeers():
       SM.notify('conntrack', upness and 'up' or 'down', *select + reason)
       for c in changes: c()
 
-def netupdown(upness, reason):
-  """
-  Add or kill peers according to whether the network is up or down.
-
-  UPNESS is true if the network is up, or false if it's down.
-  """
-
-  _kick.put((upness, reason))
-
 ###--------------------------------------------------------------------------
 ### NetworkManager monitor.