summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-07-05 19:10:40 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-07-05 19:16:55 +0200
commitd9ba5d4a6f38111b9656c91589bdc274214ac93b (patch)
tree3c81cd13ed8167783a69d4e27b4b97fced34777f /src
parent373aacd2375f35400a351345b2fa849efdae0543 (diff)
downloadvyos-1x-d9ba5d4a6f38111b9656c91589bdc274214ac93b.tar.gz
vyos-1x-d9ba5d4a6f38111b9656c91589bdc274214ac93b.zip
firewall: T2199: Fix migration when `icmpv6 type` is an integer
Diffstat (limited to 'src')
-rwxr-xr-xsrc/migration-scripts/firewall/6-to-75
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: