[Bug 2083236] Re: [SRU] Net::IP->intip return undef for IP 0.0.0.0 instead of 0
Timo Aaltonen
2083236 at bugs.launchpad.net
Fri Nov 29 17:18:01 UTC 2024
Hello Kostiantyn, or anyone else affected,
Accepted libnet-ip-perl into oracular-proposed. The package will build
now and be available at https://launchpad.net/ubuntu/+source/libnet-ip-
perl/1.26-3ubuntu0.24.10.1 in a few hours, and then in the -proposed
repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
oracular to verification-done-oracular. If it does not fix the bug for
you, please add a comment stating that, and change the tag to
verification-failed-oracular. In either case, without details of your
testing we will not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: libnet-ip-perl (Ubuntu Oracular)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-oracular
** Changed in: libnet-ip-perl (Ubuntu Noble)
Status: In Progress => Fix Committed
** Tags added: verification-needed-noble
--
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 Committed
Status in libnet-ip-perl source package in Oracular:
Fix Committed
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