]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/misc-progs/ipsecctrl.c
IPsec: Bring down connections after reloading configuration
[ipfire-2.x.git] / src / misc-progs / ipsecctrl.c
index 2a64775f025fcb6cef634bf00c173ff90d834c0c..001587fca0d72434b348e6e49dbd5016c01c3797 100644 (file)
@@ -141,14 +141,14 @@ void turn_connection_off (char *name) {
         */
         char command[STRING_SIZE];
 
+       // Reload, so the connection is dropped.
+       ipsec_reload();
+
        // Bring down the connection.
         snprintf(command, STRING_SIZE - 1, 
                 "/usr/sbin/ipsec down %s >/dev/null", name);
         safe_system(command);
 
-       // Reload, so the connection is dropped.
-       ipsec_reload();
-
        // Reload the IPsec firewall policy
        safe_system("/usr/lib/firewall/ipsec-policy >/dev/null");