diff options
author | Daniil Baturin <daniil@vyos.io> | 2020-07-26 11:52:31 +0300 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2020-07-26 11:54:08 +0300 |
commit | 5970bdca312fa857aa0b7dcc2cc202723b24e894 (patch) | |
tree | 141db8dc18333d5f7301748a29e7938a6a8014cd | |
parent | 30dd5d4107d6dc7f23ab196f9b3d6ed8a0072073 (diff) | |
download | vyatta-cfg-quagga-5970bdca312fa857aa0b7dcc2cc202723b24e894.tar.gz vyatta-cfg-quagga-5970bdca312fa857aa0b7dcc2cc202723b24e894.zip |
T2021: relax the OSPFv3 area restriction and allow decimal format.
-rwxr-xr-x | scripts/vyatta_quagga_utils.pl | 11 | ||||
-rw-r--r-- | templates/protocols/ospfv3/area/node.def | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/scripts/vyatta_quagga_utils.pl b/scripts/vyatta_quagga_utils.pl index ffeeaa04..a4c68e68 100755 --- a/scripts/vyatta_quagga_utils.pl +++ b/scripts/vyatta_quagga_utils.pl @@ -93,6 +93,15 @@ sub check_ospf_area { sub check_ospfv3_area { my $area = shift; + # allow both decimal or dotted decimal, + # In FRR post PR#6700 it's no longer an issue + # + if ( $area =~ m/^\d+$/ ) { + if ( $area >= 0 && $area <= 4294967295 ) { + exit 0; + } + } + if ( $area =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ ) { foreach my $octet ( $1, $2, $3, $4 ) { if ( ( $octet < 0 ) || ( $octet > 255 ) ) { exit 1; } @@ -100,7 +109,7 @@ sub check_ospfv3_area { exit 0; } - die "Invalid OSPF area: $area. Only dotted decimal notation is allowed.\n"; + die "Invalid OSPF area: $area\n"; } sub check_community { diff --git a/templates/protocols/ospfv3/area/node.def b/templates/protocols/ospfv3/area/node.def index 7ca50a3c..56e42038 100644 --- a/templates/protocols/ospfv3/area/node.def +++ b/templates/protocols/ospfv3/area/node.def @@ -2,4 +2,5 @@ tag: type: txt help: OSPFv3 Area syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-ospfv3-area $VAR(@)"; "Invalid OSFPv3 area \"$VAR(@)\" " +val_help: u32; OSPFv3 area in decimal notation val_help: ipv4; OSPFv3 area in dotted decimal notation |