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

Remove invalid IPv4 validation in DNS code #329 #330

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

eandersson
Copy link
Collaborator

@eandersson eandersson commented Sep 7, 2024

This is a fix for the issue with pool records that have a zero in one or more of their IP octets (e.g. 51.81.0.15). #329

The issue is that we are checking if one of the octets is a zero and if we get at least one we return without setting the DNS valid flag. If we don't get a zero we pass, but a zero in an IP octet is a perfectly valid value, so we should be passing as long as we aren't getting a null value.

Of course we could be more pedantic here as there are invalid values we could be looking for, but those are very unlikely to be received as valid DNS results, unless they are intentional (e.g. 127.0.0.1 or 0.0.0.0).

tl;dr this logic isn't really necessary and it should be enough to just remove it. Tested with a few pools and custom DNS records.

@skot
Copy link
Owner

skot commented Sep 8, 2024

looks good to me!

@skot skot merged commit 1e508f2 into skot:master Sep 8, 2024
1 check passed
@eandersson eandersson deleted the dns_fix branch October 9, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants