summaryrefslogtreecommitdiff
path: root/src/op_mode/conntrack.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-03-19 08:52:36 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-19 11:15:32 +0000
commitc5e52627e4a81a488ed63006065fce0b0af2b65f (patch)
treef827636060f99a170595b9b42a60afaa2e806fbe /src/op_mode/conntrack.py
parent7956eced02862253d28a64befe4add2449df0c89 (diff)
downloadvyos-1x-c5e52627e4a81a488ed63006065fce0b0af2b65f.tar.gz
vyos-1x-c5e52627e4a81a488ed63006065fce0b0af2b65f.zip
T6138: Fix op-mode show conntrack table with flowtable offloads
The op-mode command `show conntrack table ipv4` fails if gets a conntrack entrie with `flowtable` offload. Those entries do not have key `timeout` ``` File "/usr/libexec/vyos/op_mode/conntrack.py", line 115, in get_formatted_output timeout = meta['timeout'] ~~~~^^^^^^^^^^^ ``` Use the timeout `n/a` for those offload conntrack entries (cherry picked from commit a75be3b6814dd39711c157c29405ee6bd83993f5)
Diffstat (limited to 'src/op_mode/conntrack.py')
-rwxr-xr-xsrc/op_mode/conntrack.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/op_mode/conntrack.py b/src/op_mode/conntrack.py
index cf8adf795..6ea213bec 100755
--- a/src/op_mode/conntrack.py
+++ b/src/op_mode/conntrack.py
@@ -112,7 +112,8 @@ def get_formatted_output(dict_data):
proto = meta['layer4']['protoname']
if direction == 'independent':
conn_id = meta['id']
- timeout = meta['timeout']
+ # T6138 flowtable offload conntrack entries without 'timeout'
+ timeout = meta.get('timeout', 'n/a')
orig_src = f'{orig_src}:{orig_sport}' if orig_sport else orig_src
orig_dst = f'{orig_dst}:{orig_dport}' if orig_dport else orig_dst
reply_src = f'{reply_src}:{reply_sport}' if reply_sport else reply_src