Blame SOURCES/libreswan-3.25-1673105-down-restart.patch

ae87d2
diff -Naur libreswan-3.25-orig/include/pluto_constants.h libreswan-3.25/include/pluto_constants.h
ae87d2
--- libreswan-3.25-orig/include/pluto_constants.h	2019-05-02 10:54:07.265614654 -0400
ae87d2
+++ libreswan-3.25/include/pluto_constants.h	2019-05-02 10:55:42.634626504 -0400
ae87d2
@@ -152,6 +152,7 @@
ae87d2
 	EVENT_SD_WATCHDOG,		/* update systemd's watchdog interval */
ae87d2
 	EVENT_PENDING_PHASE2,		/* do not make pending phase2 wait forever */
ae87d2
 	EVENT_CHECK_CRLS,		/* check/update CRLS */
ae87d2
+	EVENT_REVIVE_CONNS,
ae87d2
 
ae87d2
 	/* events associated with states */
ae87d2
 
ae87d2
@@ -203,6 +204,9 @@
ae87d2
 #define EVENT_CRYPTO_TIMEOUT_DELAY	RETRANSMIT_TIMEOUT_DEFAULT /* wait till the other side give up on us */
ae87d2
 #define EVENT_PAM_TIMEOUT_DELAY		RETRANSMIT_TIMEOUT_DEFAULT /* wait until this side give up on PAM */
ae87d2
 
ae87d2
+#define REVIVE_CONN_DELAY      5 /* seconds */
ae87d2
+#define REVIVE_CONN_DELAY_MAX  300 /* Do not delay more than 5 minutes per attempt */
ae87d2
+
ae87d2
 /*
ae87d2
  * operational importance of this cryptographic operation.
ae87d2
  * this determines if the operation will be dropped (because the other
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/connections.c libreswan-3.25/programs/pluto/connections.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/connections.c	2019-05-02 10:54:07.265614654 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/connections.c	2019-05-02 10:55:42.635626515 -0400
ae87d2
@@ -4629,3 +4629,28 @@
ae87d2
 		c->name, prio));
ae87d2
 	return prio;
ae87d2
 }
ae87d2
+
ae87d2
+/*
ae87d2
+ * If the connection contains a newer SA, return it.
ae87d2
+ */
ae87d2
+so_serial_t get_newer_sa_from_connection(struct state *st)
ae87d2
+{
ae87d2
+	struct connection *c = st->st_connection;
ae87d2
+	so_serial_t newest;
ae87d2
+
ae87d2
+	if (IS_IKE_SA(st)) {
ae87d2
+		newest = c->newest_isakmp_sa;
ae87d2
+		DBG(DBG_CONTROL, DBG_log("picked newest_isakmp_sa #%lu for #%lu",
ae87d2
+			newest, st->st_serialno));
ae87d2
+        } else {
ae87d2
+                newest = c->newest_ipsec_sa;
ae87d2
+                DBG(DBG_CONTROL, DBG_log("picked newest_ipsec_sa #%lu for #%lu",
ae87d2
+                    newest, st->st_serialno));
ae87d2
+        }
ae87d2
+
ae87d2
+        if (newest != SOS_NOBODY && newest > st->st_serialno) {
ae87d2
+                return newest;
ae87d2
+        } else {
ae87d2
+                return SOS_NOBODY;
ae87d2
+        }
ae87d2
+}
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/connections.h libreswan-3.25/programs/pluto/connections.h
ae87d2
--- libreswan-3.25-orig/programs/pluto/connections.h	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/connections.h	2019-05-02 10:57:22.626689082 -0400
ae87d2
@@ -343,6 +343,7 @@
ae87d2
 	u_int32_t statsval;	/* track what we have told statsd */
ae87d2
 	u_int16_t nflog_group;	/* NFLOG group - 0 means disabled  */
ae87d2
 	msgid_t ike_window;     /* IKE v2 window size 7296#section-2.3 */
ae87d2
+	int revive_delay;
ae87d2
 };
ae87d2
 
ae87d2
 extern void parse_mark_mask(const struct connection* c,int * mark, int * mask);
ae87d2
@@ -385,7 +386,7 @@
ae87d2
 			     struct xfrm_user_sec_ctx_ike *uctx,
ae87d2
 #endif
ae87d2
 			     err_t why);
ae87d2
-extern void terminate_connection(const char *name);
ae87d2
+extern void terminate_connection(const char *name, bool quiet);
ae87d2
 extern void release_connection(struct connection *c, bool relations);
ae87d2
 extern void delete_connection(struct connection *c, bool relations);
ae87d2
 extern void suppress_delete(struct connection *c);
ae87d2
@@ -539,3 +540,8 @@
ae87d2
 extern bool idr_wildmatch(const struct connection *c, const struct id *b);
ae87d2
 
ae87d2
 extern uint32_t calculate_sa_prio(const struct connection *c);
ae87d2
+
ae87d2
+so_serial_t get_newer_sa_from_connection(struct state *st);
ae87d2
+
ae87d2
+extern void flush_revival(const struct connection *c);
ae87d2
+
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/hostpair.c libreswan-3.25/programs/pluto/hostpair.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/hostpair.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/hostpair.c	2019-05-02 10:55:42.635626515 -0400
ae87d2
@@ -274,7 +274,7 @@
ae87d2
 					 */
ae87d2
 					passert(p == *pp);
ae87d2
 
ae87d2
-					terminate_connection(p->name);
ae87d2
+					terminate_connection(p->name, FALSE);
ae87d2
 					p->interface = NULL; /* withdraw orientation */
ae87d2
 
ae87d2
 					*pp = p->hp_next; /* advance *pp */
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/initiate.c libreswan-3.25/programs/pluto/initiate.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/initiate.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/initiate.c	2019-05-02 10:55:42.640626568 -0400
ae87d2
@@ -148,7 +148,7 @@
ae87d2
 								c->interface->ip_dev->id_rname,
ae87d2
 								p->ip_dev->id_rname);
ae87d2
 							}
ae87d2
-						terminate_connection(c->name);
ae87d2
+						terminate_connection(c->name, FALSE);
ae87d2
 						c->interface = NULL; /* withdraw orientation */
ae87d2
 						return FALSE;
ae87d2
 					}
ae87d2
@@ -401,7 +401,7 @@
ae87d2
 		{
ae87d2
 			/* This might delete c if CK_INSTANCE */
ae87d2
 			/* ??? is there a chance hp becomes dangling? */
ae87d2
-			terminate_connection(d->name);
ae87d2
+			terminate_connection(d->name, FALSE);
ae87d2
 		}
ae87d2
 		d = next;
ae87d2
 	}
ae87d2
@@ -750,6 +750,12 @@
ae87d2
 				    fmt_conn_instance(c, cib));
ae87d2
 		    });
ae87d2
 
ae87d2
+		if (sr->routing == RT_ROUTED_PROSPECTIVE && eclipsable(sr)) {
ae87d2
+			DBG(DBG_CONTROL, DBG_log("route is eclipsed"));
ae87d2
+			sr->routing = RT_ROUTED_ECLIPSED;
ae87d2
+			eclipse_count++;
ae87d2
+		}
ae87d2
+
ae87d2
 		idtoa(&sr->this.id, mycredentialstr, sizeof(mycredentialstr));
ae87d2
 
ae87d2
 		passert(c->policy & POLICY_OPPORTUNISTIC); /* can't initiate Road Warrior connections */
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/kernel.c libreswan-3.25/programs/pluto/kernel.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/kernel.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/kernel.c	2019-05-02 10:55:42.640626568 -0400
ae87d2
@@ -982,22 +982,11 @@
ae87d2
 	if (ro != NULL && !routes_agree(ro, c)) {
ae87d2
 		char cib[CONN_INST_BUF];
ae87d2
 		loglog(RC_LOG_SERIOUS,
ae87d2
-			"cannot route -- route already in use for \"%s\"%s",
ae87d2
+			"cannot route -- route already in use for \"%s\"%s - but allowing anyway",
ae87d2
 			ro->name, fmt_conn_instance(ro, cib));
ae87d2
-		/*
ae87d2
-		 * We ignore this if the stack supports overlapping, and this
ae87d2
-		 * connection was marked that overlapping is OK.  Below we will
ae87d2
-		 * check the other eroute, ero.
ae87d2
-		 */
ae87d2
-		if (!compatible_overlapping_connections(c, ero)) {
ae87d2
-			/*
ae87d2
-			 * Another connection is already using the eroute.
ae87d2
-			 * TODO: NETKEY can do this?
ae87d2
-			 */
ae87d2
-			return route_impossible;
ae87d2
-		}
ae87d2
 	}
ae87d2
 
ae87d2
+
ae87d2
 	/* if there is an eroute for another connection, there is a problem */
ae87d2
 	if (ero != NULL && ero != c) {
ae87d2
 		/*
ae87d2
@@ -3080,7 +3069,8 @@
ae87d2
 		/* record unrouting */
ae87d2
 		if (route_installed) {
ae87d2
 			do {
ae87d2
-				passert(!erouted(rosr->routing));
ae87d2
+				 DBG(DBG_CONTROL,
ae87d2
+					DBG_log("ro name=%s, rosr->routing=%d", ro->name, rosr->routing));
ae87d2
 				rosr->routing = RT_UNROUTED;
ae87d2
 
ae87d2
 				/* no need to keep old value */
ae87d2
@@ -3292,6 +3282,14 @@
ae87d2
 		DBG(DBG_KERNEL,
ae87d2
 			DBG_log("set up incoming SA, ref=%u/%u", st->st_ref,
ae87d2
 				st->st_refhim));
ae87d2
+
ae87d2
+		/*
ae87d2
+		 * We successfully installed an IPsec SA, meaning it is safe
ae87d2
+		 * to clear our revival back-off delay. This is based on the
ae87d2
+		 * assumption that an unwilling partner might complete an IKE
ae87d2
+		 * SA to us, but won't complete an IPsec SA to us.
ae87d2
+		 */
ae87d2
+		st->st_connection->revive_delay = 0;
ae87d2
 	}
ae87d2
 
ae87d2
 	if (rb == route_unnecessary)
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/kernel.h libreswan-3.25/programs/pluto/kernel.h
ae87d2
--- libreswan-3.25-orig/programs/pluto/kernel.h	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/kernel.h	2019-05-02 10:55:42.640626568 -0400
ae87d2
@@ -421,14 +421,6 @@
ae87d2
 #endif
ae87d2
 			      );
ae87d2
 
ae87d2
-static inline bool compatible_overlapping_connections(const struct connection *a,
ae87d2
-						      const struct connection *b)
ae87d2
-{
ae87d2
-	return kernel_ops->overlap_supported &&
ae87d2
-	       a != NULL && b != NULL &&
ae87d2
-	       a != b &&
ae87d2
-	       LIN(POLICY_OVERLAPIP, a->policy & b->policy);
ae87d2
-}
ae87d2
 
ae87d2
 #ifdef KLIPS
ae87d2
 extern const struct kernel_ops klips_kernel_ops;
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/pluto_constants.c libreswan-3.25/programs/pluto/pluto_constants.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/pluto_constants.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/pluto_constants.c	2019-05-02 10:55:42.636626526 -0400
ae87d2
@@ -121,6 +121,7 @@
ae87d2
 	"EVENT_SD_WATCHDOG",
ae87d2
 	"EVENT_PENDING_PHASE2",
ae87d2
 	"EVENT_CHECK_CRLS",
ae87d2
+	"EVENT_REVIVE_CONNS",
ae87d2
 
ae87d2
 	"EVENT_SO_DISCARD",
ae87d2
 	"EVENT_v1_RETRANSMIT",
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/rcv_whack.c libreswan-3.25/programs/pluto/rcv_whack.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/rcv_whack.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/rcv_whack.c	2019-05-02 10:55:42.636626526 -0400
ae87d2
@@ -380,8 +380,14 @@
ae87d2
 	 * To make this more useful, in only this combination,
ae87d2
 	 * delete will silently ignore the lack of the connection.
ae87d2
 	 */
ae87d2
-	if (m->whack_delete)
ae87d2
-		delete_connections_by_name(m->name, !m->whack_connection);
ae87d2
+	if (m->whack_delete) {
ae87d2
+		if (m->name == NULL) {
ae87d2
+			whack_log(RC_FATAL, "received whack command to delete a connection, but did not receive the connection name - ignored"); 
ae87d2
+		} else {
ae87d2
+			terminate_connection(m->name, TRUE);
ae87d2
+			delete_connections_by_name(m->name, !m->whack_connection);
ae87d2
+		}
ae87d2
+	}
ae87d2
 
ae87d2
 	if (m->whack_deleteuser) {
ae87d2
 		DBG_log("received whack to delete connection by user %s",
ae87d2
@@ -573,7 +579,7 @@
ae87d2
 	}
ae87d2
 
ae87d2
 	if (m->whack_terminate)
ae87d2
-		terminate_connection(m->name);
ae87d2
+		terminate_connection(m->name, TRUE);
ae87d2
 
ae87d2
 	if (m->whack_status)
ae87d2
 		show_status();
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/state.c libreswan-3.25/programs/pluto/state.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/state.c	2019-05-02 10:54:07.252614517 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/state.c	2019-05-02 10:56:28.447113336 -0400
ae87d2
@@ -77,6 +77,8 @@
ae87d2
 #include "crypt_dh.h"
ae87d2
 #include "hostpair.h"
ae87d2
 
ae87d2
+#include "kernel.h"
ae87d2
+
ae87d2
 #include <nss.h>
ae87d2
 #include <pk11pub.h>
ae87d2
 #include <keyhi.h>
ae87d2
@@ -128,6 +130,115 @@
ae87d2
 	[STATE_UNDEFINED] = &state_undefined,
ae87d2
 };
ae87d2
 
ae87d2
+/*
ae87d2
+ * Revival mechanism: keep track of connections
ae87d2
+ * that should be kept up, even though all their
ae87d2
+ * states have been deleted.
ae87d2
+ *
ae87d2
+ * We record the connection names.
ae87d2
+ * Each name is recorded only once.
ae87d2
+ *
ae87d2
+ * XXX: This functionality totally overlaps both "initiate" and
ae87d2
+ * "pending" and should be merged (howerver, this simple code might
ae87d2
+ * prove to be a better starting point).
ae87d2
+ */
ae87d2
+
ae87d2
+struct revival {
ae87d2
+	char *name;
ae87d2
+	struct revival *next;
ae87d2
+};
ae87d2
+
ae87d2
+static struct revival *revivals = NULL;
ae87d2
+
ae87d2
+/*
ae87d2
+ * XXX: Return connection C's revival object's link, if found.  If the
ae87d2
+ * connection C can't be found, then the address of the revival list's
ae87d2
+ * tail is returned.  Perhaps, exiting the loop and returning NULL
ae87d2
+ * would be more obvious.
ae87d2
+ */
ae87d2
+static struct revival **find_revival(const struct connection *c)
ae87d2
+{
ae87d2
+	for (struct revival **rp = &revivals; ; rp = &(*rp)->next) {
ae87d2
+		if (*rp == NULL || streq((*rp)->name, c->name)) {
ae87d2
+			return rp;
ae87d2
+		}
ae87d2
+	}
ae87d2
+}
ae87d2
+
ae87d2
+/*
ae87d2
+ * XXX: In addition to freeing RP (and killing the pointer), this
ae87d2
+ * "free" function has the side effect of unlinks RP from the revival
ae87d2
+ * list.  Perhaps free*() isn't the best name.
ae87d2
+ */
ae87d2
+static void free_revival(struct revival **rp)
ae87d2
+{
ae87d2
+	struct revival *r = *rp;
ae87d2
+	*rp = r->next;
ae87d2
+	pfree(r->name);
ae87d2
+	pfree(r);
ae87d2
+}
ae87d2
+
ae87d2
+void flush_revival(const struct connection *c)
ae87d2
+{
ae87d2
+	struct revival **rp = find_revival(c);
ae87d2
+
ae87d2
+	if (*rp == NULL) {
ae87d2
+		DBG(DBG_CONTROL, DBG_log("flush revival: connection '%s' wasn't on the list",
ae87d2
+		    c->name));
ae87d2
+	} else {
ae87d2
+		DBG(DBG_CONTROL, DBG_log("flush revival: connection '%s' revival flushed",
ae87d2
+		    c->name));
ae87d2
+		free_revival(rp);
ae87d2
+	}
ae87d2
+}
ae87d2
+
ae87d2
+static void add_revival(struct connection *c)
ae87d2
+{
ae87d2
+	if (*find_revival(c) == NULL) {
ae87d2
+		struct revival *r = alloc_thing(struct revival,
ae87d2
+						"revival struct");
ae87d2
+
ae87d2
+		r->name = clone_str(c->name, "revival conn name");
ae87d2
+		r->next = revivals;
ae87d2
+		revivals = r;
ae87d2
+		int delay = c->revive_delay;
ae87d2
+		DBG(DBG_CONTROL, DBG_log("add revival: connection '%s' added to the list and scheduled for %d seconds",
ae87d2
+		    c->name, delay));
ae87d2
+		c->revive_delay = min(delay + REVIVE_CONN_DELAY,
ae87d2
+						REVIVE_CONN_DELAY_MAX);
ae87d2
+		/*
ae87d2
+		 * XXX: Schedule the next revival using this
ae87d2
+		 * connection's revival delay and not the most urgent
ae87d2
+		 * connection's revival delay.  Trying to fix this
ae87d2
+		 * here just is annoying and probably of marginal
ae87d2
+		 * benefit: it is something better handled with a
ae87d2
+		 * proper connection event so that the event loop deal
ae87d2
+		 * with all the math (this code would then be
ae87d2
+		 * deleted); and would encroach even further on
ae87d2
+		 * "initiate" and "pending" functionality.
ae87d2
+		 */
ae87d2
+		event_schedule(EVENT_REVIVE_CONNS, deltatime(delay), NULL);
ae87d2
+	}
ae87d2
+}
ae87d2
+
ae87d2
+void revive_conns(void)
ae87d2
+{
ae87d2
+	/*
ae87d2
+	 * XXX: Revive all listed connections regardless of their
ae87d2
+	 * DELAY.  See note above in add_revival().
ae87d2
+	 */
ae87d2
+	while (revivals != NULL) {
ae87d2
+		libreswan_log("Initiating connection %s which received a Delete/Notify but must remain up per local policy",
ae87d2
+			revivals->name);
ae87d2
+		initiate_connection(revivals->name, NULL_FD, empty_lmod, empty_lmod, pcim_demand_crypto, NULL);
ae87d2
+		free_revival(&revivals);
ae87d2
+	}
ae87d2
+}
ae87d2
+
ae87d2
+/* end of revival mechanism */
ae87d2
+
ae87d2
+
ae87d2
+
ae87d2
 void lswlog_finite_state(struct lswlog *buf, const struct finite_state *fs)
ae87d2
 {
ae87d2
 	if (fs == NULL) {
ae87d2
@@ -1156,6 +1267,23 @@
ae87d2
 	if (c->newest_isakmp_sa == st->st_serialno)
ae87d2
 		c->newest_isakmp_sa = SOS_NOBODY;
ae87d2
 
ae87d2
+	if ((c->policy & POLICY_UP) && IS_IKE_SA(st)) {
ae87d2
+		so_serial_t newer_sa = get_newer_sa_from_connection(st);
ae87d2
+
ae87d2
+		if (state_by_serialno(newer_sa) != NULL) {
ae87d2
+			/*
ae87d2
+			 * Presumably this is an old state that has
ae87d2
+			 * either been rekeyed or replaced.
ae87d2
+			 */
ae87d2
+			DBG(DBG_CONTROL, DBG_log("IKE delete_state() for #%lu and connection '%s' that is supposed to remain up;  not a problem - have newer #%lu",
ae87d2
+                            st->st_serialno, c->name, newer_sa));
ae87d2
+		} else {
ae87d2
+			libreswan_log("deleting IKE SA for connection '%s' but connection is supposed to remain up; schedule EVENT_REVIVE_CONNS",
ae87d2
+				c->name);
ae87d2
+			add_revival(c);
ae87d2
+		}
ae87d2
+	}
ae87d2
+
ae87d2
 	/*
ae87d2
 	 * fake a state change here while we are still associated with a
ae87d2
 	 * connection.  Without this the state logging (when enabled) cannot
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/state.h libreswan-3.25/programs/pluto/state.h
ae87d2
--- libreswan-3.25-orig/programs/pluto/state.h	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/state.h	2019-05-02 10:55:42.638626547 -0400
ae87d2
@@ -809,5 +809,5 @@
ae87d2
 
ae87d2
 extern bool uniqueIDs;  /* --uniqueids? */
ae87d2
 extern void ISAKMP_SA_established(const struct state *pst);
ae87d2
-
ae87d2
+extern void revive_conns(void);
ae87d2
 #endif /* _STATE_H */
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/terminate.c libreswan-3.25/programs/pluto/terminate.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/terminate.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/terminate.c	2019-05-02 10:55:42.638626547 -0400
ae87d2
@@ -90,7 +90,7 @@
ae87d2
 	return 1;
ae87d2
 }
ae87d2
 
ae87d2
-void terminate_connection(const char *name)
ae87d2
+void terminate_connection(const char *name, bool quiet)
ae87d2
 {
ae87d2
 	/*
ae87d2
 	 * Loop because more than one may match (master and instances)
ae87d2
@@ -112,7 +112,8 @@
ae87d2
 	} else {
ae87d2
 		int count = foreach_connection_by_alias(name, terminate_a_connection, NULL);
ae87d2
 		if (count == 0) {
ae87d2
-			loglog(RC_UNKNOWN_NAME,
ae87d2
+			if (!quiet)
ae87d2
+				loglog(RC_UNKNOWN_NAME,
ae87d2
 				  "no such connection or aliased connection named \"%s\"", name);
ae87d2
 		} else {
ae87d2
 			loglog(RC_COMMENT, "terminated %d connections from aliased connection \"%s\"",
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/timer.c libreswan-3.25/programs/pluto/timer.c
ae87d2
--- libreswan-3.25-orig/programs/pluto/timer.c	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/timer.c	2019-05-02 10:55:42.638626547 -0400
ae87d2
@@ -334,6 +334,7 @@
ae87d2
 	case EVENT_SD_WATCHDOG:
ae87d2
 	case EVENT_NAT_T_KEEPALIVE:
ae87d2
 	case EVENT_CHECK_CRLS:
ae87d2
+	case EVENT_REVIVE_CONNS:
ae87d2
 		passert(st == NULL);
ae87d2
 		break;
ae87d2
 
ae87d2
@@ -435,6 +436,10 @@
ae87d2
 		check_crls();
ae87d2
 		break;
ae87d2
 
ae87d2
+	case EVENT_REVIVE_CONNS:
ae87d2
+		revive_conns();
ae87d2
+		break;
ae87d2
+
ae87d2
 	case EVENT_v2_RELEASE_WHACK:
ae87d2
 		DBG(DBG_CONTROL, DBG_log("%s releasing whack for #%lu %s (sock=%d)",
ae87d2
 					enum_show(&timer_event_names, type),
ae87d2
diff -Naur libreswan-3.25-orig/programs/pluto/timer.h libreswan-3.25/programs/pluto/timer.h
ae87d2
--- libreswan-3.25-orig/programs/pluto/timer.h	2018-06-27 11:42:26.000000000 -0400
ae87d2
+++ libreswan-3.25/programs/pluto/timer.h	2019-05-02 10:55:42.638626547 -0400
ae87d2
@@ -47,4 +47,6 @@
ae87d2
 #define delete_dpd_event(ST) delete_state_event((ST), &(ST)->st_dpd_event)
ae87d2
 
ae87d2
 extern void timer_list(void);
ae87d2
+extern char *revive_conn;
ae87d2
+
ae87d2
 #endif /* _TIMER_H */