diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-07-05 22:09:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 22:09:57 +0200 |
commit | f794ed27e3991bff9bd41e868f53a5b393a519d3 (patch) | |
tree | 3c81cd13ed8167783a69d4e27b4b97fced34777f /src/migration-scripts/firewall/6-to-7 | |
parent | 373aacd2375f35400a351345b2fa849efdae0543 (diff) | |
parent | d9ba5d4a6f38111b9656c91589bdc274214ac93b (diff) | |
download | vyos-1x-f794ed27e3991bff9bd41e868f53a5b393a519d3.tar.gz vyos-1x-f794ed27e3991bff9bd41e868f53a5b393a519d3.zip |
Merge pull request #1393 from sarthurdev/firewall_migrate
firewall: T2199: Fix migration when `icmpv6 type` is an integer
Diffstat (limited to 'src/migration-scripts/firewall/6-to-7')
-rwxr-xr-x | src/migration-scripts/firewall/6-to-7 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/migration-scripts/firewall/6-to-7 b/src/migration-scripts/firewall/6-to-7 index 5f4cff90d..626d6849f 100755 --- a/src/migration-scripts/firewall/6-to-7 +++ b/src/migration-scripts/firewall/6-to-7 @@ -194,11 +194,12 @@ if config.exists(base + ['ipv6-name']): if config.exists(rule_icmp + ['type']): tmp = config.return_value(rule_icmp + ['type']) - type_code_match = re.match(r'^(\d+)/(\d+)$', tmp) + type_code_match = re.match(r'^(\d+)(?:/(\d+))?$', tmp) if type_code_match: config.set(rule_icmp + ['type'], value=type_code_match[1]) - config.set(rule_icmp + ['code'], value=type_code_match[2]) + if type_code_match[2]: + config.set(rule_icmp + ['code'], value=type_code_match[2]) elif tmp in icmpv6_remove: config.delete(rule_icmp + ['type']) elif tmp in icmpv6_translations: |