From: Wolfgang Bumiller Date: Thu, 22 Oct 2015 13:45:24 +0000 (+0200) Subject: read_prox_net_ipv6_route fixup X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=ef67212cf2d01b230d9b070d4e382bce15530fe4 read_prox_net_ipv6_route fixup - read_v6addr used the wrong $_ - All values in the file are hex and possibly prefixed with zeroes so we need to make sure they don't get interpreted as octal. --- diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index 3dc5680..9c9eb81 100644 --- a/src/PVE/ProcFSTools.pm +++ b/src/PVE/ProcFSTools.pm @@ -311,16 +311,16 @@ sub read_proc_net_ipv6_route { my $fh = IO::File->new ($filename, "r"); return $res if !$fh; - my $read_v6addr = sub { s/....(?!$)/$&:/g }; + my $read_v6addr = sub { $_[0] =~ s/....(?!$)/$&:/gr }; # ipv6_route has no header while (defined(my $line = <$fh>)) { my ($dest, $prefix, $nexthop, $metric, $iface) = (split(/\s+/, $line))[0,1,4,5,9]; push @$res, { dest => &$read_v6addr($dest), - prefix => $prefix, + prefix => hex("$prefix"), gateway => &$read_v6addr($nexthop), - metric => $metric, + metric => hex("$metric"), iface => $iface }; }