use Time::HiRes qw (gettimeofday);
use IO::File;
use PVE::Tools;
+use Cwd qw();
my $clock_ticks = POSIX::sysconf(&POSIX::_SC_CLK_TCK);
sub is_mounted {
my ($mountpoint) = @_;
+ $mountpoint = Cwd::realpath($mountpoint);
+
my $mountdata = read_proc_mounts();
if ($mountdata =~ m/\s$mountpoint\s/) {
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
};
}