Skip to content

Commit

Permalink
standardize IPv6 address formatting to RFC 5952
Browse files Browse the repository at this point in the history
  • Loading branch information
mzagrabe committed Jan 23, 2017
1 parent 30681d7 commit 9f65014
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions htdocs/management/ip.html
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@
my $ip = new NetAddr::IP($o->address, $o->prefix);

push( @field_headers, "Netmask:", "Broadcast:" );
push( @cell_data, $ip->mask);
push( @cell_data, ($ip->version == 4 ? $ip->mask : '/'.$o->prefix) );
push( @cell_data, ($ip->version == 4 ? $ip->broadcast->addr : "n/a") );

################
Expand All @@ -1365,8 +1365,8 @@
}
}else{
$num_addresses = $o->num_addr;
$first_address = $ip->network->addr;
$last_address = $ip->broadcast->addr;
$first_address = $ip->network->canon;
$last_address = $ip->broadcast->canon;
}
push( @cell_data, ($num_addresses." (". $first_address." - ".$last_address.")") );

Expand Down
2 changes: 1 addition & 1 deletion lib/Netdot/Model/Ipblock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use base 'Netdot::Model';
use warnings;
use strict;
use Math::BigInt;
use NetAddr::IP;
use NetAddr::IP qw(:lower);
use Net::Patricia 1.19_01;
use Storable qw(nfreeze thaw);
use Scalar::Util qw(blessed);
Expand Down

0 comments on commit 9f65014

Please sign in to comment.