Blob Blame History Raw
commit fb4587bfd6d0f6e034d1421a70639cc97a11307b
Author: Tore Anderson <tore@fud.no>
Date:   Mon Mar 28 08:26:20 2016 +0200

    nm-dispatcher: only act on iface up/down events
    
    Ensure other events (like hostname changes, DHCP lease renewals, etc.)
    are ignored as they are very unlikely to be relevant for clatd.

diff --git a/scripts/clatd.networkmanager b/scripts/clatd.networkmanager
index 4187959..8a815ba 100644
--- a/scripts/clatd.networkmanager
+++ b/scripts/clatd.networkmanager
@@ -14,6 +14,11 @@
 # committing suicide from the restarts below
 [ "$DEVICE_IFACE" = "clat" ] && exit 0
 
+# We're only acting on interface "up" or "down" events. NM will run the
+# dispatcher scripts for other events we're not interested in, like the
+# hostname being set or a DHCP lease being renewed. Ignore those.
+[ "$2" != "up" ] && [ "$2" != "down" ] && exit 0
+
 # We simply restart clatd in all situations, as no matter if an interface
 # goes up or down, it may mean that the PLAT device changes, it may mean
 # native IPv4 appearing or disappearing, or it may mean that DNS64 became