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

Ensure the MQTT address is an IPv4 before determining it's private #5081

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

JohnathonMohr
Copy link
Contributor

Continuing from #5072, ensuring no sneaking subdomains make an address appear like a private IPv4.

This is also now tested. :)

@JohnathonMohr
Copy link
Contributor Author

@jp-bennett @fifieldt Next iteration is here. :)

Copy link
Contributor

@fifieldt fifieldt left a comment

Choose a reason for hiding this comment

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

Hey, is it worth checking the length?

@JohnathonMohr
Copy link
Contributor Author

Hey, is it worth checking the length?

We could. I opted not to initially for the same reason of just checking for digits and dots: even if it's not valid, a connection won't be made.

It's easy enough though, so I can if you want.

@JohnathonMohr
Copy link
Contributor Author

Ok, length check added. 😅

@thebentern thebentern merged commit 3e5f129 into meshtastic:master Oct 16, 2024
44 of 45 checks passed
@JohnathonMohr JohnathonMohr deleted the safe-private-ipv4 branch October 16, 2024 10:56
@CamFlyerCH
Copy link

I have to add a non-standard port number (like 192.168.1.84:2883) and the detection is not detecting it as a private IP anymore.

@JohnathonMohr
Copy link
Contributor Author

I have to add a non-standard port number (like 192.168.1.84:2883) and the detection is not detecting it as a private IP anymore.

@CamFlyerCH yep, I realized that earlier. The fix is in #5084.

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.

5 participants