Problem
IO::Interface doesn't list interfaces which are up but don't have assigned IP in version 1.09. The same are listed in version 1.08.
Culprit
After the switch to Module::Build in c4de691 the build system doesn't provide -DUSE_GETIFADDRS to gcc and interfaces are collected using different logic compared to version 1.08.
Reproduction
I use this simple print.pl script to test which interfaces are returned by the module:
#!/usr/bin/perl
use IO::Interface::Simple;
my @iflist = IO::Interface::Simple->interfaces;
print join(',', @iflist) . "\n";
1.08
- Install 1.08 version
cpanm LDS/IO-Interface-1.08
- Configure eth1
ifconfig eth1 up 10.10.10.10
- eth1 is listed
./print.pl | grep eth1
- Remove address from eth1
ifconfig eth1 0.0.0.0
- eth1 is again listed
./print.pl | grep eth1
1.09
- Install 1.09 version
cpanm LDS/IO-Interface-1.09
- Configure eth1
ifconfig eth1 up 10.10.10.10
- eth1 is listed
./print.pl | grep eth1
- Remove address from eth1
ifconfig eth1 0.0.0.0
- eth1 is not listed
./print.pl | grep eth1
Additional information
- Perl version:
This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux
- uname -a:
Linux machine 3.14.27-gentoo #1 SMP Tue Jan 13 09:12:34 UTC 2015 x86_64 Intel(R) Xeon(R) CPU E5-2440 0 @ 2.40GHz GenuineIntel GNU/Linux
- I hardcoded as a test
#define USE_GETIFADDRS at the start of Interface.xs file and the behavior between the two versions was the same. But this is ugly and was made just for the check.