Do not spawn strongswan ipsec for admin down connections

Honor admin_state_up flag when handling vpn connection.

Change-Id: I9b053aa11ed03cdb8d441ca05c7e8faabe1fc140
This commit is contained in:
Vasyl Saienko 2022-12-23 09:41:34 +00:00
parent 972f681851
commit 41584eb897
1 changed files with 2 additions and 0 deletions

View File

@ -193,6 +193,8 @@ class StrongSwanProcess(ipsec.BaseSwanProcess):
self._execute([self.binary, 'start'])
# initiate ipsec connection
for ipsec_site_conn in self.vpnservice['ipsec_site_connections']:
if not ipsec_site_conn['admin_state_up']:
continue
self._execute([self.binary, 'stroke', 'up-nb',
ipsec_site_conn['id']])