Skip Menu |
 

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

Report information
The Basics
Id: 95631
Status: resolved
Priority: 0/
Queue: Net-IP

People
Owner: cpan [...] bat.ru
Requestors: ABeeson [...] csu.edu.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.26



Subject: reverse_ip removes too many quads from certain v4 IP's
Date: Wed, 14 May 2014 16:03:22 +1000
To: "bug-Net-IP [...] rt.cpan.org" <bug-Net-IP [...] rt.cpan.org>
From: "Beeson, Ayden" <ABeeson [...] csu.edu.au>
Download (untitled) / with headers
text/plain 2.4k
I have found a bug in Net::IP where reverse_ip is taking off too many 0's from IP addresses. An example is 10.0.0.1 - I want to get the reverse subnet for it, (assuming it is a /24 network you are working with) sending reverse_ip 10.0.0.1/24 results in 10.in-addr.arpa. I have checked the code and found that the problem is the way the v4 addresses are being handled, there is a while that simply keeps looking for zeroes and removes them until there are no more zeroes at the start of the reverse. while (@reverse_quads and $reverse_quads[0] == 0) { shift(@reverse_quads); } It also appears that a length calculation is done to get the number of quads but it's never checked. Changing the while to this: while (@reverse_quads and $reverse_quads[0] == 0 and scalar(@reverse_quads) > $no_quads) { shift(@reverse_quads); } Will fix the problem in the most graceful way I could come up with quickly. [cid:csu-logo66bf.bmp]<http://www.csu.edu.au/> | ALBURY-WODONGA | BATHURST | CANBERRA | DUBBO | GOULBURN | MELBOURNE | ONTARIO | ORANGE | PORT MACQUARIE | SYDNEY | WAGGA WAGGA | Show quoted text
________________________________ LEGAL NOTICE This email (and any attachment) is confidential and is intended for the use of the addressee(s) only. If you are not the intended recipient of this email, you must not copy, distribute, take any action in reliance on it or disclose it to anyone. Any confidentiality is not waived or lost by reason of mistaken delivery. Email should be checked for viruses and defects before opening. Charles Sturt University (CSU) does not accept liability for viruses or any consequence which arise as a result of this email transmission. Email communications with CSU may be subject to automated email filtering, which could result in the delay or deletion of a legitimate email before it is read at CSU. The views expressed in this email are not necessarily those of CSU. Charles Sturt University in Australia<http://www.csu.edu.au> The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN: 83 878 708 551; CRICOS Provider Number: 00005F (National)). TEQSA Provider Number: PV12018 Charles Sturt University in Ontario<http://www.charlessturt.ca/> 860 Harrington Court, Burlington Ontario Canada L7N 3N4 Registration: www.peqab.ca<http://www.peqab.ca> Consider the environment before printing this email. Disclaimer added by CodeTwo Exchange Rules 2007 www.codetwo.com<http://www.codetwo.com>
csu-logo66bf.bmp
Subject: RE: [rt.cpan.org #95631] AutoReply: reverse_ip removes too many quads from certain v4 IP's
Date: Mon, 1 Sep 2014 15:49:18 +1000
To: "'bug-Net-IP [...] rt.cpan.org'" <bug-Net-IP [...] rt.cpan.org>
From: "Beeson, Ayden" <ABeeson [...] csu.edu.au>
FYI - test case for this: perl use Net::IP; my $ip = Net::IP->new("10.0.0.0/24"); print $ip->reverse_ip(); Should return: 0.0.10.in-addr.arpa. Does return: 10.in-addr.arpa. Thanks, Ayden Beeson Show quoted text
-----Original Message----- From: Bugs in Net-IP via RT [mailto:bug-Net-IP@rt.cpan.org] Sent: Wednesday, 14 May 2014 4:04 PM To: Beeson, Ayden Subject: [rt.cpan.org #95631] AutoReply: reverse_ip removes too many quads from certain v4 IP's Greetings, This message has been automatically generated in response to the creation of a trouble ticket regarding: "reverse_ip removes too many quads from certain v4 IP's", a summary of which appears below. There is no need to reply to this message right now. Your ticket has been assigned an ID of [rt.cpan.org #95631]. Your ticket is accessible on the web at: https://rt.cpan.org/Ticket/Display.html?id=95631 Please include the string: [rt.cpan.org #95631] in the subject line of all future correspondence about this issue. To do so, you may reply to this message. Thank you, bug-Net-IP@rt.cpan.org ------------------------------------------------------------------------- I have found a bug in Net::IP where reverse_ip is taking off too many 0's from IP addresses. An example is 10.0.0.1 - I want to get the reverse subnet for it, (assuming it is a /24 network you are working with) sending reverse_ip 10.0.0.1/24 results in 10.in-addr.arpa. I have checked the code and found that the problem is the way the v4 addresses are being handled, there is a while that simply keeps looking for zeroes and removes them until there are no more zeroes at the start of the reverse. while (@reverse_quads and $reverse_quads[0] == 0) { shift(@reverse_quads); } It also appears that a length calculation is done to get the number of quads but it's never checked. Changing the while to this: while (@reverse_quads and $reverse_quads[0] == 0 and scalar(@reverse_quads) > $no_quads) { shift(@reverse_quads); } Will fix the problem in the most graceful way I could come up with quickly. [cid:csu-logo66bf.bmp]<http://www.csu.edu.au/> | ALBURY-WODONGA | BATHURST | CANBERRA | DUBBO | GOULBURN | MELBOURNE | ONTARIO | ORANGE | PORT MACQUARIE | SYDNEY | WAGGA WAGGA |
________________________________ LEGAL NOTICE This email (and any attachment) is confidential and is intended for the use of the addressee(s) only. If you are not the intended recipient of this email, you must not copy, distribute, take any action in reliance on it or disclose it to anyone. Any confidentiality is not waived or lost by reason of mistaken delivery. Email should be checked for viruses and defects before opening. Charles Sturt University (CSU) does not accept liability for viruses or any consequence which arise as a result of this email transmission. Email communications with CSU may be subject to automated email filtering, which could result in the delay or deletion of a legitimate email before it is read at CSU. The views expressed in this email are not necessarily those of CSU. Charles Sturt University in Australia<http://www.csu.edu.au> The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN: 83 878 708 551; CRICOS Provider Number: 00005F (National)). TEQSA Provider Number: PV12018 Charles Sturt University in Ontario<http://www.charlessturt.ca/> 860 Harrington Court, Burlington Ontario Canada L7N 3N4 Registration: www.peqab.ca<http://www.peqab.ca> Consider the environment before printing this email. Disclaimer added by CodeTwo Exchange Rules 2007 www.codetwo.com<http://www.codetwo.com> Charles Sturt University | ALBURY-WODONGA | BATHURST | CANBERRA | DUBBO | GOULBURN | MELBOURNE | ONTARIO | ORANGE | PORT MACQUARIE | SYDNEY | WAGGA WAGGA | LEGAL NOTICE This email (and any attachment) is confidential and is intended for the use of the addressee(s) only. If you are not the intended recipient of this email, you must not copy, distribute, take any action in reliance on it or disclose it to anyone. Any confidentiality is not waived or lost by reason of mistaken delivery. Email should be checked for viruses and defects before opening. Charles Sturt University (CSU) does not accept liability for viruses or any consequence which arise as a result of this email transmission. Email communications with CSU may be subject to automated email filtering, which could result in the delay or deletion of a legitimate email before it is read at CSU. The views expressed in this email are not necessarily those of CSU. Charles Sturt University in Australia http://www.csu.edu.au The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN: 83 878 708 551; CRICOS Provider Numbers: 00005F (NSW), 01947G (VIC), 02960B (ACT)). TEQSA Provider Number: PV12018 Charles Sturt University in Ontario http://www.charlessturt.ca 860 Harrington Court, Burlington Ontario Canada L7N 3N4 Registration: www.peqab.ca Consider the environment before printing this email.
Subject: [rt.cpan.org #95631]
Date: Mon, 1 Sep 2014 16:54:09 +1000
To: "'bug-Net-IP [...] rt.cpan.org'" <bug-Net-IP [...] rt.cpan.org>
From: "Beeson, Ayden" <ABeeson [...] csu.edu.au>
Download (untitled) / with headers
text/plain 1.9k
Also bad title, it should be "reverse_ip removes too many octets from certain IPv4 addresses" I had been working on too much IPv6 stuff when I wrote the original email.... Thanks, Ayden Beeson B.InfoTech, CCNA Technology Specialist (Networks) Division Of Information Technology Charles Sturt University P.O. Box 789 Albury NSW 2640 Ph :02 60519788 Fax:02 60519919 abeeson@csu.edu.au<mailto:abeeson@csu.edu.au> www.csu.edu.au<http://www.csu.edu.au/> [cid:csu-logoc1e.bmp]<http://www.csu.edu.au/> | ALBURY-WODONGA | BATHURST | CANBERRA | DUBBO | GOULBURN | MELBOURNE | ONTARIO | ORANGE | PORT MACQUARIE | SYDNEY | WAGGA WAGGA | Show quoted text
________________________________ LEGAL NOTICE This email (and any attachment) is confidential and is intended for the use of the addressee(s) only. If you are not the intended recipient of this email, you must not copy, distribute, take any action in reliance on it or disclose it to anyone. Any confidentiality is not waived or lost by reason of mistaken delivery. Email should be checked for viruses and defects before opening. Charles Sturt University (CSU) does not accept liability for viruses or any consequence which arise as a result of this email transmission. Email communications with CSU may be subject to automated email filtering, which could result in the delay or deletion of a legitimate email before it is read at CSU. The views expressed in this email are not necessarily those of CSU. Charles Sturt University in Australia<http://www.csu.edu.au> The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN: 83 878 708 551; CRICOS Provider Number: 00005F (National)). TEQSA Provider Number: PV12018 Charles Sturt University in Ontario<http://www.charlessturt.ca/> 860 Harrington Court, Burlington Ontario Canada L7N 3N4 Registration: www.peqab.ca<http://www.peqab.ca> [cid:anniversay2120.bmp] Consider the environment before printing this email.
Download csu-logoc1e.bmp
image/bmp 37k
csu-logoc1e.bmp
Download anniversay2120.bmp
image/bmp 52.6k
anniversay2120.bmp
Download (untitled) / with headers
text/plain 313b
On Mon Sep 01 01:49:34 2014, ABeeson@csu.edu.au wrote: Show quoted text
> FYI - test case for this: > > perl > use Net::IP; > my $ip = Net::IP->new("10.0.0.0/24"); > print $ip->reverse_ip(); > > Should return: > 0.0.10.in-addr.arpa. > > Does return: > 10.in-addr.arpa.
That should be fixed in 1.27. Thanks for the report!
Subject: RE: [rt.cpan.org #95631] Resolved: reverse_ip removes too many quads from certain v4 IP's
Date: Tue, 22 Sep 2015 05:59:55 +0000
To: "'bug-Net-IP [...] rt.cpan.org'" <bug-Net-IP [...] rt.cpan.org>
From: "Beeson, Ayden" <ABeeson [...] csu.edu.au>
Download (untitled) / with headers
text/plain 1.9k
I presume this fix will actually be in 1.27, rather than the 1.26 it was closed with. Any ETA on 1.27? Thanks, Ayden Beeson Show quoted text
-----Original Message----- From: Timur I. Bakeyev via RT [mailto:bug-Net-IP@rt.cpan.org] Sent: Tuesday, 22 September 2015 8:02 AM To: Beeson, Ayden Subject: [rt.cpan.org #95631] Resolved: reverse_ip removes too many quads from certain v4 IP's <URL: https://rt.cpan.org/Ticket/Display.html?id=95631 > According to our records, your request has been resolved. If you have any further questions or concerns, please respond to this message. Charles Sturt University | ALBURY-WODONGA | BATHURST | CANBERRA | DUBBO | GOULBURN | MELBOURNE | ONTARIO | ORANGE | PORT MACQUARIE | SYDNEY | WAGGA WAGGA | LEGAL NOTICE This email (and any attachment) is confidential and is intended for the use of the addressee(s) only. If you are not the intended recipient of this email, you must not copy, distribute, take any action in reliance on it or disclose it to anyone. Any confidentiality is not waived or lost by reason of mistaken delivery. Email should be checked for viruses and defects before opening. Charles Sturt University (CSU) does not accept liability for viruses or any consequence which arise as a result of this email transmission. Email communications with CSU may be subject to automated email filtering, which could result in the delay or deletion of a legitimate email before it is read at CSU. The views expressed in this email are not necessarily those of CSU. Charles Sturt University in Australia http://www.csu.edu.au The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN: 83 878 708 551; CRICOS Provider Numbers: 00005F (NSW), 01947G (VIC), 02960B (ACT)). TEQSA Provider Number: PV12018 Charles Sturt University in Ontario http://www.charlessturt.ca 860 Harrington Court, Burlington Ontario Canada L7N 3N4 Registration: www.peqab.ca Consider the environment before printing this email.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.