lstein / LibIO-Interface-Perl

Perl interface to Unix network interface API
Artistic License 2.0
4 stars 3 forks source link

Version 1.09 doesn't list some interfaces #2

Open avortimid opened 9 years ago

avortimid commented 9 years ago
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 c4de69113e5bdbb2355611774efc19e19f5b4529 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
  1. Install 1.08 version cpanm LDS/IO-Interface-1.08
  2. Configure eth1 ifconfig eth1 up 10.10.10.10
  3. eth1 is listed ./print.pl | grep eth1
  4. Remove address from eth1 ifconfig eth1 0.0.0.0
  5. eth1 is again listed ./print.pl | grep eth1
    1.09
  6. Install 1.09 version cpanm LDS/IO-Interface-1.09
  7. Configure eth1 ifconfig eth1 up 10.10.10.10
  8. eth1 is listed ./print.pl | grep eth1
  9. Remove address from eth1 ifconfig eth1 0.0.0.0
  10. eth1 is not listed ./print.pl | grep eth1

    Additional information

  11. Perl version:
    This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux
  12. 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
  13. 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.