Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug in Net::IP with a work around. Issue #1107 #1108

Closed

Conversation

matsduf
Copy link
Contributor

@matsduf matsduf commented Jul 26, 2022

Purpose

Net::IP does not make correct reverse name when last octet is a "0". This is a work-around the bug.

Context

Resolves #1107

How to test this PR

On a system where Net::IP::XS is not installed (e.g. CentOS 7) run the following command and verify that one of the last lines have a PTR query where the IP address ends with "0" and that the name is correct.

zonemaster-cli 15.248.151.in-addr.arpa --raw --show_testcase --test address/address02 --level DEBUG

@matsduf matsduf added the T-Bug Type: Bug in software or error in test case description label Jul 26, 2022
@matsduf matsduf added this to the v2022.2 milestone Jul 26, 2022
@matsduf matsduf requested review from mattias-p, hannaeko, a user, tgreenx and marc-vanderwal July 26, 2022 15:50
@matsduf matsduf linked an issue Jul 26, 2022 that may be closed by this pull request
@anandb-ripencc
Copy link
Contributor

Can be fixed by explicitly installing Net::IP::XS

@matsduf
Copy link
Contributor Author

matsduf commented Jul 26, 2022

Can be fixed by explicitly installing Net::IP::XS

The fix is still needed. Firstly, we know that the Docker installation is affected. It is unknown if the Rocky Linux is affected. Secondly, as long as Zonemaster supports running with Net::IP, which is an alternative dependency, the bug must be worked around.

@matsduf matsduf force-pushed the fix-issue-1107-net-ip-bug branch from dfd60f2 to b6efbb3 Compare July 26, 2022 21:29
@ghost
Copy link

ghost commented Jul 27, 2022

as long as Zonemaster supports running with Net::IP

Couldn't Zonemaster depend on Net::IP::XS instead of Net::IP?

@matsduf
Copy link
Contributor Author

matsduf commented Jul 27, 2022

Couldn't Zonemaster depend on Net::IP::XS instead of Net::IP?

Maybe. But as far as I can see Alpine Linux does not have any package with Net::IP::XS.

My solution is a work-around that I think the code should have as long as it uses Net::IP as an alternative dependency. If that is removed, the work-around is not needed.

@ghost
Copy link

ghost commented Jul 27, 2022

But as far as I can see Alpine Linux does not have any package with Net::IP::XS.

Can't we install it from CPAN? It looks like we already install some packages from CPAN.

@matsduf
Copy link
Contributor Author

matsduf commented Jul 27, 2022

Can't we install it from CPAN? It looks like we already install some packages from CPAN.

Possibly. When I saw the issue I also saw a simple work-around that would be safe add. If Net::IP is kept, I think the work-around is a correct solution, if Net::IP is dropped, the work-around is not needed and should not be kept or added.

@anandb-ripencc
Copy link
Contributor

I don't understand the problem with the Docker image. In the Dockerfile, I see that you're installing some perl modules from packages, and then some directly from CPAN using cpanm. So you can just remove the perl-net-ip package, and instead add Net::IP::XS to the list of modules installed directly from CPAN.

To add to this discussion, our RIPE NCC Zonemaster build does NOT use any perl modules from the base distribution. We're using cpanm to install EVERYTHING into a perl local::lib directory. We do this, because we don't like mixing OS provided perl modules and CPAN provided perl modules, because it causes massive confusion.

To summarise, I think you should remove Net::IP as a dependency, and specify only Net::IP::XS as a dependency. If it's available as a package, a user can install it. Otherwise, it comes from CPAN.

@matsduf
Copy link
Contributor Author

matsduf commented Jul 28, 2022

This is a work-around that is required if Net::IP is used. Nothing else.

@tgreenx tgreenx linked an issue Jul 28, 2022 that may be closed by this pull request
@hannaeko
Copy link
Member

To summarise, I think you should remove Net::IP as a dependency, and specify only Net::IP::XS as a dependency. If it's available as a package, a user can install it. Otherwise, it comes from CPAN.

I agree with this, even on a performance aspect Net::IP::XS performs way better, if we could have only this one as a dependency it would be nice.

Copy link
Contributor

@marc-vanderwal marc-vanderwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@anandb-ripencc
Copy link
Contributor

This PR will be obsoleted once #1119 is merged, so it's better to close this. There's no need for this work-around.

@matsduf
Copy link
Contributor Author

matsduf commented Sep 15, 2022

@mvw-afnic, can you review #1119 instead? When that is merged I will close this.

@matsduf
Copy link
Contributor Author

matsduf commented Sep 16, 2022

Replaced by #1119

@matsduf matsduf closed this Sep 16, 2022
@matsduf matsduf deleted the fix-issue-1107-net-ip-bug branch September 16, 2022 15:14
@marc-vanderwal
Copy link
Contributor

Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Bug Type: Bug in software or error in test case description
Projects
None yet
4 participants