diff options
author | Daniil Baturin <daniil@baturin.org> | 2011-12-20 01:56:46 +0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2011-12-20 01:56:46 +0700 |
commit | 80d6815a9d4ee5c9634dc1e563bf84d0ecc02fa7 (patch) | |
tree | 769b841193fcef93e62af5e15852c37f4b3a5443 | |
parent | 918231a5ca05fb68dcb73759dedf3dd7293e6c34 (diff) | |
download | vyos-utils-misc-80d6815a9d4ee5c9634dc1e563bf84d0ecc02fa7.tar.gz vyos-utils-misc-80d6815a9d4ee5c9634dc1e563bf84d0ecc02fa7.zip |
Fix IPv6 prefix/access list conversion (patch provided by Jeeves).
-rw-r--r-- | converters/qvconvert.pl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/converters/qvconvert.pl b/converters/qvconvert.pl index 6cd76e0..374a70a 100644 --- a/converters/qvconvert.pl +++ b/converters/qvconvert.pl @@ -29,6 +29,7 @@ use strict; use warnings; +use Data::Dumper; use Getopt::Long; # Show help @@ -81,6 +82,7 @@ my $acl_rule = 0; # Route-map beginning string my $rm_begin = ''; +my $pl = ''; foreach(@quagga_config) { @@ -179,14 +181,28 @@ foreach(@quagga_config) { my @words = split( / /, $_ ); - my $pl_begin = "set policy prefix-list6 ".$words[2]." rule ".$words[4]; + $acl_rule += $rule_step; + if( $pl ne $words[2] ) + { + # Previous access list has ended, reset rule counter + $acl_rule = $first_rule; + $pl = $words[2]; + } + + if( $acl_rule > 65535 ) + { + print "Error: access-list rule number exceeded allowed value!\n"; + print "Try decreasing rule step by using --rule-step=n option"; + exit(1); + } + my $pl_begin = "set policy prefix-list6 ".$words[2]." rule ".$acl_rule; - print $pl_begin." action ".$words[5]."\n"; - print $pl_begin." prefix ".$words[6]."\n"; - if( $words[7] ) + print $pl_begin." action ".$words[3]."\n"; + print $pl_begin." prefix ".$words[4]."\n"; + if( $words[6] ) { # It has "le" or "ge" statement - print $pl_begin." ".$words[7]." ".$words[8]; + print $pl_begin." ".$words[5]." ".$words[6]; } } |