Bug#955496: RFS: libsys-hostaddr-perl/0.993-1 [ITP] -- Get IP address information about this host
On Wed, Apr 01, 2020 at 05:51:28PM +0200, Hilmar Preusse wrote:
> * Package name : libsys-hostaddr-perl
> Version : 0.993-1
> Upstream Author : Jeremy Kister|http://jeremy.kister.net/
> * URL : https://metacpan.org/release/Sys-HostAddr
> Changes since the last upload:
>
> * Initial release. (Closes: #955449).
Hi!
I'm not quite sure if this particular implementation is adequate. So far
I noticed that it:
* has seen no updates since 2014
* relies on a long-deprecated interface, via a tool that hasn't seen an
upstream release since April 2001
* has non-working support for IPv6
* its support for IPv4 isn't stellar either
* doesn't handle lack of answer or answers it doesn't understand
* provides only partial answers
For example:
perl -e 'use Sys::HostAddr;use Data::Dumper; print "\e[33m$_\e[0m\n", eval("Dumper(Sys::HostAddr->new()->$_())") for qw(public interfaces addresses ip first_ip main_ip)'
Modification of a read-only value attempted at /usr/share/perl5/Sys/HostAddr.pm line 68.
public
$VAR1 = undef;
interfaces
$VAR1 = [
'br0',
'eth0',
'lo'
];
addresses
$VAR1 = [
'10.0.1.9',
'127.0.0.1'
];
ip
$VAR1 = {
'lo' => [
{
'netmask' => '255.0.0.0',
'address' => '127.0.0.1'
}
],
'br0' => [
{
'netmask' => '255.255.255.0',
'address' => '10.0.1.9'
}
]
};
first_ip
$VAR1 = '10.0.1.9';
main_ip
$VAR1 = '10.0.1.9';
(error message from public(), 192.168.0.9 on br0 is missing in other calls)
After disabling legacy IP:
Can't use an undefined value as a symbol reference at /usr/share/perl5/Sys/HostAddr.pm line 60.
public
$VAR1 = undef;
interfaces
$VAR1 = [
'br0',
'eth0',
'lo'
];
addresses
$VAR1 = [
'127.0.0.1'
];
ip
$VAR1 = {
'lo' => [
{
'netmask' => '255.0.0.0',
'address' => '127.0.0.1'
}
]
};
first_ip
main_ip
(a different error from public())
Thus, I wonder if there's a better module to do this task.
Meow!
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ in the beginning was the boot and root floppies and they were good.
⢿⡄⠘⠷⠚⠋⠀ -- <willmore> on #linux-sunxi
⠈⠳⣄⠀⠀⠀⠀
Reply to: