From fe9500ad26ea61a8e89f20158a4a927ba99e0a56 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Sun, 27 Jul 2008 15:03:37 -0700 Subject: Fix check_prefix_boundry() to handle IPv6 abreviated addresses. --- scripts/vyatta_quagga_utils.pl | 10 ++++++---- 1 file 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; } -- cgit v1.2.3