Fix connection status reporting when using LibreSwan 4

The regex-pattern used to check for connection liveness needs to remove
the IPSec-keyword to correctly detect active connections on LibreSwan 4.

Closes-Bug: #2089252
Change-Id: I76f04842025e6d676e372e7394a3c5ab04d0d129
This commit is contained in:
Trygve Vea
2024-12-05 23:44:51 +01:00
parent 2c644d3a5a
commit 0bac8169cd

View File

@@ -187,9 +187,9 @@ class BaseSwanProcess(metaclass=abc.ABCMeta):
STATUS_RE = r'\d\d\d "([a-f0-9\-]+).* (unrouted|erouted);'
STATUS_NOT_RUNNING_RE = 'Command:.*ipsec.*status.*Exit code: [1|3]$'
STATUS_IPSEC_SA_ESTABLISHED_RE = (
r'\d{3} #\d+: "([a-f0-9\-]+).*established.*newest IPSEC')
r'\d{3} #\d+: "([a-f0-9\-]+).*established.*newest')
STATUS_IPSEC_SA_ESTABLISHED_RE2 = (
r'\d{3} #\d+: "([a-f0-9\-\/x]+).*established.*newest IPSEC')
r'\d{3} #\d+: "([a-f0-9\-\/x]+).*established.*newest')
def __init__(self, conf, process_id, vpnservice, namespace):
self.conf = conf