[Swan-dev] refine_host_connection switching back to template

Paul Wouters paul at nohats.ca
Tue Nov 14 02:54:55 UTC 2017


Sometimes we see an instance connection switching back to the template
it instantiated from. I am wondering how we can prevent this. It seems
the only way to figure out a connection we found is the template we
instantiated from is:

+	/* Ignore template from which we instantiated */
+	if (c->kind == CK_INSTANCE && d->kind == CK_TEMPLATE && streq(c->name, d->name))
+		continue;

This seems rather fragile (and might not work for OE connections where
we change the connection name).

Am I missing something, or should we addd a new variable in the
connection struct to track which connection we instantiated from?

I think doing a ipsec auto --replace connname does take down the
instances, so maybe there is a way of tracking that I am not aware of?

Paul


More information about the Swan-dev mailing list