summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorRuben Herold <ruben@puettmann.net>2026-08-04 13:17:20 +0200
committerRuben Herold <ruben@puettmann.net>2026-08-04 13:17:20 +0200
commit57115dba2fae263b8923cdc5f4a827f49fa680e4 (patch)
tree9e9a77a18ef6d6278a6a43298c60cbe75bb80dcc /src/migration-scripts
parentdd2673bf9ad36ea7ecb6998b71f318516b95e8d8 (diff)
downloadvyos-1x-57115dba2fae263b8923cdc5f4a827f49fa680e4.tar.gz
vyos-1x-57115dba2fae263b8923cdc5f4a827f49fa680e4.zip
nat: T9162: fix KeyError when show nat rules has no inbound-interface
_get_formatted_output_rules() and _get_formatted_output_statistics() detected an interface match by checking whether *any* expr in the rule has a left.meta field, then unconditionally read expr[0]'s match.right as the interface. Both assumptions are wrong: meta is also used for non-interface matches (e.g. meta l4proto from a protocol match), and the interface match is not guaranteed to be first. For a rule with a protocol match but no inbound-interface, this read the address/port match's right-hand side (a dict) as if it were the interface string, raising KeyError: 0 on interface[0] instead of falling back to 'any'. Search expr entries explicitly for a left.meta.key == 'iifname' match instead, and guard the '@' set-name stripping with a type check.
Diffstat (limited to 'src/migration-scripts')
0 files changed, 0 insertions, 0 deletions