[Bug 2083236] Update Released
Brian Murray
2083236 at bugs.launchpad.net
Tue Dec 10 15:03:30 UTC 2024
The verification of the Stable Release Update for libnet-ip-perl has
completed successfully and the package is now being released to
-updates. Subsequently, the Ubuntu Stable Release Updates Team is being
unsubscribed and will not receive messages about this bug report. In
the event that you encounter a regression using the package from
-updates please report a new bug using ubuntu-bug and tag the bug report
regression-update so we can easily find any regressions.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to libnet-ip-perl in Ubuntu.
https://bugs.launchpad.net/bugs/2083236
Title:
[SRU] Net::IP->intip return undef for IP 0.0.0.0 instead of 0
Status in libnet-ip-perl package in Ubuntu:
Fix Released
Status in libnet-ip-perl source package in Trusty:
Won't Fix
Status in libnet-ip-perl source package in Xenial:
Won't Fix
Status in libnet-ip-perl source package in Bionic:
Won't Fix
Status in libnet-ip-perl source package in Focal:
Fix Committed
Status in libnet-ip-perl source package in Jammy:
Fix Committed
Status in libnet-ip-perl source package in Noble:
Fix Released
Status in libnet-ip-perl source package in Oracular:
Fix Released
Bug description:
[ Impact ]
* This perl module doesn't calculate correctly the equivalent integer value for
an IP of only zeros (0.0.0.0).
* This leads to unpredictable error-prone behavior in the pieces of code that
use it because an uninitialised value is not expected as a result of the
intip conversion.
[ Test Plan ]
Using the script attached in comment #4 we could see the bad case and
validate the good one.
#0 Preparation in a container (e.g., Focal)
#0.0 Enabling container
lxc launch ubuntu-daily:focal Flibnet-ip-perl
lxc shell Flibnet-ip-perl
#0.1 Getting test script and install requirements packages to be executed:
apt update
apt install libnet-ip-perl libdata-dumper-concise-perl
wget https://bugs.launchpad.net/ubuntu/+source/libnet-ip-perl/+bug/2083236/+attachment/5827083/+files/ip_intip_method.pl
#1 Execution
perl ip_intip_method.pl 0.0.0.0
### Bad case
# Note the error message and the errno and error "... uninitialized value ..."
root at Flibnet-ip-perl:~# perl ip_intip_method.pl 0.0.0.0
Use of uninitialized value in concatenation (.) or string at ip_intip_method.pl line 15.
"IP : 0.0.0.0"
"Int : "
bless( {
binip => "00000000000000000000000000000000",
binmask => "11111111111111111111111111111111",
errno => undef,
error => undef,
ip => "0.0.0.0",
ipversion => 4,
is_prefix => 1,
last_bin => "00000000000000000000000000000000",
last_ip => "0.0.0.0",
prefixlen => 32,
}, 'Net::IP' )
### Good case (after upgrading package from proposed following [1])
# Note that error message disappears and it return an Math::BigInt object (intformat with value of 0)
root at Flibnet-ip-perl:~# perl ip_intip_method.pl 0.0.0.0
"IP : 0.0.0.0"
"Int : 0"
bless( {
binip => "00000000000000000000000000000000",
binmask => "11111111111111111111111111111111",
intformat => bless( {
sign => "+",
value => bless( [
0,
], 'Math::BigInt::Calc' ),
}, 'Math::BigInt' ),
ip => "0.0.0.0",
ipversion => 4,
is_prefix => 1,
last_bin => "00000000000000000000000000000000",
last_ip => "0.0.0.0",
prefixlen => 32,
}, 'Net::IP' )
[1] https://wiki.ubuntu.com/Testing/EnableProposed
[ Where problems could occur ]
The change affects only operations that involve the necessity of having the
IP as an integer, so there shouldn't be regressions for other computations.
Nevertheless, programmers who didn't notice this undefined value could see
differences when executing ad-hoc code that uses this perl module. If they were
conscious of it but put remedies in place (with exceptions u other
mechanisms), they wouldn't notice the change, but that code will no longer
needed.
[ Other Info ]
The fix has been incorporated in Debian as per comment #5 (thanks
Gregor!)
The package has a test suite that runs at build time that passes ok.
[Original Report]
--------------------------------------------------------------------------------
This issue is related to CPAN RT#60439
(https://rt.cpan.org/Public/Bug/Display.html?id=60439) which was
closed but never integrated to the lib code.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libnet-ip-perl/+bug/2083236/+subscriptions
More information about the foundations-bugs
mailing list