Skip Menu |

This queue is for tickets about the Net-Interface CPAN distribution.

Report information
The Basics
Id: 38793
Status: resolved
Priority: 0/
Queue: Net-Interface

People
Owner: Nobody in particular
Requestors: REHSACK [...] cpan.org
Cc: rehsack [...] web.de
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 0.08
  • 0.09
Fixed in: (no value)



CC: rehsack [...] web.de
Subject: Insufficient bug fix on Net::Interface 0.09 / invalid handling of ifreq
As I wrote at 07/28/08 to Michael Robinton <michael@bizsystems.com>, Jerrad Pierce <jpierce@cpan.org>, Net::Interface doesn't recognize the result of SIOCGIFCONF ioctl call correctly. I discussed this erroneous behaviour with Brooks Davis on freebsd-net@freebsd.org around 07/21/08. At first I submitted a patch solving the Problem for FreeBSD 7-STABLE and AIX 5.3 TL8 but ported it back to Linux (RHEL4) now. Here is the bug report for it, if desired I attach the wrong output for versions 0.08 and 0.09. The patch is against version 0.08, because noone answered to my e-Mail so I don't recognize that there're people working on it. The diff between Net::Interface 0.08 and 0.09 doesn't look as it would solve any problems. BTW
Subject: patch-Net-Interface
Download patch-Net-Interface
application/octet-stream 11.2k

Message body not shown because it is not plain text.

RT-Send-CC: keith [...] blekko.com
On Thu Aug 28 08:57:24 2008, REHSACK wrote: Show quoted text
> As I wrote at 07/28/08 to Michael Robinton <michael@bizsystems.com>, > Jerrad Pierce <jpierce@cpan.org>, Net::Interface doesn't recognize the > result of SIOCGIFCONF ioctl call correctly. > > I discussed this erroneous behaviour with Brooks Davis on > freebsd-net@freebsd.org around 07/21/08. At first I submitted a patch > solving the Problem for FreeBSD 7-STABLE and AIX 5.3 TL8 but ported it > back to Linux (RHEL4) now. > > Here is the bug report for it, if desired I attach the wrong output > for > versions 0.08 and 0.09. The patch is against version 0.08, because > noone > answered to my e-Mail so I don't recognize that there're people > working > on it. > > The diff between Net::Interface 0.08 and 0.09 doesn't look as it would > solve any problems. BTW
Jens, I've applied your patch to 0.08 and sent the resulting file to Keith Peters, the gentleman that submitted the MAC patch for 0.08 which resulted in the release of 0.09 Your patch breaks on the MAC darwin platform. I wonder if you two might correspond and try to work out the differences. I only have SUN and Linux boxes to work on and can not make a meaningful contribution to this bug fix. Keith's comments follow. Michael ################### First pass had a compile error: keith-peters-computer:Net-Interface-0.10 keith$ perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Net::Interface keith-peters-computer:Net-Interface-0.10 keith$ make all test cp Interface.pm blib/lib/Net/Interface.pm cc -c -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" Interface.c Interface.xs:174: error: PAGE_SIZE undeclared here (not in a function) Interface.xs:174: error: PAGE_SIZE undeclared here (not in a function) lipo: can't open input file: /var/folders/ti/tiyspH0IHuWeCIyTWVy8GU+++TI/-Tmp-//ccjRIpQt.out (No such file or directory) make: *** [Interface.o] Error 1 I added: #ifndef PAGE_SIZE #define PAGE_SIZE 64000 #endif (Though I'm not sure what an appropriate value would be) keith-peters-computer:Net-Interface-0.10 keith$ make all test /usr/bin/perl /System/Library/Perl/5.8.8/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.8/ExtUtils/typemap Interface.xs > Interface.xsc && mv Interface.xsc Interface.c cc -c -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" Interface.c Running Mkbootstrap for Net::Interface () chmod 644 Interface.bs rm -f blib/arch/auto/Net/Interface/Interface.bundle cc -mmacosx-version-min=10.5 -arch i386 -arch ppc -bundle -undefined dynamic_lookup -L/usr/local/lib Interface.o -o blib/arch/auto/Net/Interface/Interface.bundle \ -lc \ chmod 755 blib/arch/auto/Net/Interface/Interface.bundle cp Interface.bs blib/arch/auto/Net/Interface/Interface.bs chmod 644 blib/arch/auto/Net/Interface/Interface.bs Manifying blib/man3/Net::Interface.3pm PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/if.............NI_ACCESS: : Operation not permitted t/if.............ok 1/7Use of uninitialized value in subroutine entry at t/if.t line 35. NI_ACCESS: : Operation not permitted t/if.............dubious Test returned status 0 (wstat 10, 0xa) DIED. FAILED tests 6-7 Failed 2/7 tests, 71.43% okay t/mac_bin2hex....ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/if.t 0 10 7 4 57.14% 6-7 Failed 1/2 test scripts, 50.00% okay. 2/9 subtests failed, 77.78% okay. make: *** [test_dynamic] Error 255 I guess macs have trouble setting MTU on lo0. But it get's what I need from it done. I also get some spurious "NI_ACCESS : Can't assign requested address" messages as well which are similar to the test failure message. The appears to be caused by the fact that some of my interfaces don't have addresses but have AF_LINK setup properly. I don't know enough about the ioctl to be able to debug that one further. And I don't know how to make my code aware of whether or not the address would exists until calling "->address" and checking for undef. Just so you know how weird the ifconfig on a mac is... keith-peters-computer:b keith$ ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 00:1b:63:98:3a:6f media: autoselect status: inactive supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control> none fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078 lladdr 00:1c:b3:ff:fe:81:1c:7a media: autoselect <full-duplex> status: inactive supported media: autoselect <full-duplex> en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet6 fe80::21c:b3ff:feb7:be86%en1 prefixlen 64 scopeid 0x6 inet 192.168.1.151 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:1c:b3:b7:be:86 media: autoselect status: active supported media: autoselect -Keith
Show quoted text
> Your patch breaks on the MAC darwin platform.
If it does just because of PAGE_SIZE, this should be easy fixable ... Show quoted text
> I wonder if you two might correspond and try to work out the > differences. I only have SUN and Linux boxes to work on and can not > make > a meaningful contribution to this bug fix.
I have FreeBSD, AIX, Linux and since yesterday (my girl friend) a Mac OS X. Show quoted text
> Keith's comments follow. > > Michael > > > ################### > > First pass had a compile error: > > Interface.xs:174: error: PAGE_SIZE undeclared here (not in a function)
So on Mac OS X PAGE_SIZE is declared somewhere else than in sys/limits.h ;-) Show quoted text
> I added: > > #ifndef PAGE_SIZE > #define PAGE_SIZE 64000 > #endif > > (Though I'm not sure what an appropriate value would be)
Usually on Intel processors it's 4096 or 4096*1024 (PAE). Give me a few days and I figure it out (after I setup all things, my girl friend want on her new computer ^^) - I'm wondering why Mac OS X behaves different than FreeBSD there. /Jens
RT-Send-CC: keith [...] blekko.com
I've fixed the issue with missing PAGE_SIZE on MacOS X platforms (patch-aa) and fixed the test (patch-ab). Both patches are against Net-Interface-0.08. I'm sorry for the delay, but our Mac was most time blocked ;-) Details to the fix of t/if.t: Keith was right with most of his assumptions - but using ifconfig lo0 127.0.0.1 netmask 255.0.0.0 should workaround. The final test fails because the assumption that the first entry in @names is the loopback address fails on some platforms (AIX, FreeBSD, Linux, ...)
Download patch-ab
application/octet-stream 2.3k

Message body not shown because it is not plain text.

Download patch-aa
application/octet-stream 11.3k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #38793] Insufficient bug fix on Net::Interface 0.09 / invalid handling of ifreq
Date: Sat, 27 Sep 2008 11:09:49 -0700
To: bug-Net-Interface [...] rt.cpan.org
From: michael [...] insulin-pumpers.org
Show quoted text
> Queue: Net-Interface > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=38793 > > > I've fixed the issue with missing PAGE_SIZE on MacOS X platforms > (patch-aa) and fixed the test (patch-ab). > Both patches are against Net-Interface-0.08. > I'm sorry for the delay, but our Mac was most time blocked ;-) > > Details to the fix of t/if.t: > Keith was right with most of his assumptions - but using ifconfig lo0 > 127.0.0.1 netmask 255.0.0.0 should workaround. The final test fails > because the assumption that the first entry in @names is the loopback > address fails on some platforms (AIX, FreeBSD, Linux, ...) > >
Thanks Jens, Patches applied and version 0.10 uploaded to CPAN Best regards, Michael
Patchs submitted by Jens Rehsack REHSACK@cpan.org applied to version 0.10 and uploaded to CPAN