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

NAT Mode DHCP range fields need data validation #419

Closed
ab7pa opened this issue Jun 29, 2022 · 2 comments
Closed

NAT Mode DHCP range fields need data validation #419

ab7pa opened this issue Jun 29, 2022 · 2 comments

Comments

@ab7pa
Copy link
Contributor

ab7pa commented Jun 29, 2022

Forum post reports "Bad Gateway" messages on the Setup page in certain cases when using NAT Mode. https://www.arednmesh.org/content/navigating-cgi-binsetup-gives-502-bad-gateway-status-code

I looked at the support dump this operator posted on the forum and I see in /etc/config.mesh/_setup that "dmz_mode = 0" and that "dmz_dhcp_end = " (empty value). On my test node when I clear the DHCP End value on the Setup page, press Save Changes, then the "Bad Gateway" message appears. Some data validation could prevent empty values and force numeric values in those fields when in NAT Mode.

@aanon4
Copy link
Contributor

aanon4 commented Jul 13, 2022

So looking at /etc/config.mesh/_setup I see the following values:

dmz_dhcp_end =
dmz_dhcp_limit = -1

Clearly _end is blank which is bad, but _limit is -1 which is also bad. I'm not sure how this file got corrupted (I assume by the perl code at some point in the past, and it's much more blasé about empty strings being the value 0) but the user could edit this by hand to fix it.

I'll look at adding some code to prevent (or default) the blank DHCP End value.

@aanon4
Copy link
Contributor

aanon4 commented Jul 13, 2022

#430

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

No branches or pull requests

3 participants