diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-10-28 20:14:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 20:14:04 +0200 |
commit | fcff58dbe9d5a099eccbefb43c304801d434ac17 (patch) | |
tree | 6fd6c7d309829840cf85ecfe583ee5a8182564d4 /src/op_mode/show_ipsec_sa.py | |
parent | 64994acb6f106626f94743a3e47057f613a0d2fb (diff) | |
parent | 75facc61c3e66a8ddd3f02000338df15621425d4 (diff) | |
download | vyos-1x-fcff58dbe9d5a099eccbefb43c304801d434ac17.tar.gz vyos-1x-fcff58dbe9d5a099eccbefb43c304801d434ac17.zip |
Merge pull request #1050 from sever-sever/T3941-equ
IPSec: T3941: Fix uptime for tunnels sa op-mode
Diffstat (limited to 'src/op_mode/show_ipsec_sa.py')
-rwxr-xr-x | src/op_mode/show_ipsec_sa.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/op_mode/show_ipsec_sa.py b/src/op_mode/show_ipsec_sa.py index 8b8f11947..503366dd8 100755 --- a/src/op_mode/show_ipsec_sa.py +++ b/src/op_mode/show_ipsec_sa.py @@ -57,10 +57,7 @@ for sa in sas: else: state = "down" - if state == "up": - uptime = vyos.util.seconds_to_human(parent_sa["established"].decode()) - else: - uptime = "N/A" + uptime = "N/A" remote_host = parent_sa["remote-host"].decode() remote_id = parent_sa["remote-id"].decode() @@ -88,6 +85,8 @@ for sa in sas: # Remove B from <1K values pkts_str = re.sub(r'B', r'', pkts_str) + uptime = vyos.util.seconds_to_human(isa['install-time'].decode()) + enc = isa["encr-alg"].decode() if "encr-keysize" in isa: key_size = isa["encr-keysize"].decode() |