ipsecctrl: Call ipsec-interfaces script when turning up/shutting down connections
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Dec 2018 16:23:06 +0000 (16:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Feb 2019 18:20:36 +0000 (18:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/misc-progs/ipsecctrl.c

index 8e6b46e..2a64775 100644 (file)
@@ -119,6 +119,9 @@ void turn_connection_on(char *name, char *type) {
        // Reload the IPsec firewall policy
        safe_system("/usr/lib/firewall/ipsec-policy >/dev/null");
 
+       // Create or destroy interfaces
+       safe_system("/usr/local/bin/ipsec-interfaces >/dev/null");
+
        // Reload the configuration into the daemon (#10339).
        ipsec_reload();
 
@@ -148,6 +151,9 @@ void turn_connection_off (char *name) {
 
        // Reload the IPsec firewall policy
        safe_system("/usr/lib/firewall/ipsec-policy >/dev/null");
+
+       // Create or destroy interfaces
+       safe_system("/usr/local/bin/ipsec-interfaces >/dev/null");
 }
 
 int main(int argc, char *argv[]) {
@@ -181,6 +187,7 @@ int main(int argc, char *argv[]) {
                 if (strcmp(argv[1], "D") == 0) {
                         safe_system("/usr/sbin/ipsec stop >/dev/null 2>&1");
                        safe_system("/usr/lib/firewall/ipsec-policy >/dev/null");
+                       safe_system("/usr/local/bin/ipsec-interfaces >/dev/null");
                         exit(0);
                 }
         }
@@ -207,6 +214,7 @@ int main(int argc, char *argv[]) {
        // start the system
         if ((argc == 2) && strcmp(argv[1], "S") == 0) {
                safe_system("/usr/lib/firewall/ipsec-policy >/dev/null");
+               safe_system("/usr/local/bin/ipsec-interfaces >/dev/null");
                safe_system("/usr/sbin/ipsec restart >/dev/null");
                 exit(0);
         }