diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-07-27 15:03:37 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-07-27 15:03:37 -0700 |
commit | fe9500ad26ea61a8e89f20158a4a927ba99e0a56 (patch) | |
tree | 8538593f6944342a7546ec966b0c3ba42481c5bc | |
parent | 1a2eec7ac911aa1e455de7b1a2e71d3536ac83af (diff) | |
download | vyatta-cfg-quagga-fe9500ad26ea61a8e89f20158a4a927ba99e0a56.tar.gz vyatta-cfg-quagga-fe9500ad26ea61a8e89f20158a4a927ba99e0a56.zip |
Fix check_prefix_boundry() to handle IPv6 abreviated addresses.
-rw-r--r-- | scripts/vyatta_quagga_utils.pl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/vyatta_quagga_utils.pl b/scripts/vyatta_quagga_utils.pl index e2e871f8..8806e120 100644 --- a/scripts/vyatta_quagga_utils.pl +++ b/scripts/vyatta_quagga_utils.pl @@ -20,12 +20,14 @@ exit 0; sub check_prefix_boundry() { my $prefix = shift; - my $net, $cidr; + my ($net, $network, $cidr); $net = new NetAddr::IP $prefix; - $cidr = $net->network(); - if ( "$cidr" ne "$prefix" ) { - print "Your prefix must fall on a natural network boundry. Did you mean $cidr?\n"; + $network = $net->network(); + $cidr = $net->cidr(); + if ("$cidr" ne "$network") { + print "Your prefix must fall on a natural network boundry. ", + "Did you mean $network?\n"; exit 1; } |