group.of.nepali.translators team mailing list archive
-
group.of.nepali.translators team
-
Mailing list archive
-
Message #48568
[Bug 2083236] Re: [SRU] Net::IP->intip return undef for IP 0.0.0.0 instead of 0
This bug was fixed in the package libnet-ip-perl - 1.26-2ubuntu0.22.04.1
---------------
libnet-ip-perl (1.26-2ubuntu0.22.04.1) jammy; urgency=medium
* d/p/debian/patches/Net-IP-1.26-rt60439.patch: Add patch to let
Net::IP deal with zero IPs or networks based (LP: #2083236).
-- Miriam España Acebal <miriam.espana@xxxxxxxxxxxxx> Thu, 28 Nov 2024
09:44:43 +0100
** Changed in: libnet-ip-perl (Ubuntu Jammy)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
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 Released
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@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@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