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

luci-mod-network: validate DHCP leasetime input #7455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

morse-lyall
Copy link

Without validation, dnsmasq can fail silently if users enter invalid leasetime input. This change adds input validation to align user input with the backend parsing logic. Whilst it does not enforce the >120 seconds requirement, this is documented in the field description and handled by dnsmasq's option.c, which adjusts values <120 to meet this minimum.

  • This PR is not from my main or master branch 💩, but a separate branch ✅
  • Each commit has a valid ✒️ Signed-off-by: <[email protected]> row (via git commit --signoff)
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • Incremented 🆙 any PKG_VERSION in the Makefile
  • Tested on: (x86_64, v24.10-SNAPSHOT, Chrome 131.0.6778.87) ✅
  • ( Preferred ) Mention: @ the original code author for feedback
  • ( Preferred ) Screenshot or mp4 of changes:
  • ( Optional ) Closes: e.g. openwrt/luci#issue-number
  • ( Optional ) Depends on: e.g. openwrt/packages#pr-number in sister repo
  • Description: Add a validation function to the "Lease time" input field in Network -> Interfaces -> Edit -> DHCP Server -> General Setup.

@morse-lyall morse-lyall force-pushed the validate-dhcp-server-leasetime-input branch from 705e56b to 1032ca1 Compare December 8, 2024 22:12
Without validation, `dnsmasq` can fail silently if users enter
invalid leasetime input. This change adds input validation to
align user input with the backend parsing logic. Whilst it does
not enforce the >120 seconds requirement, this is documented
in the field description and handled by `dnsmasq`'s `option.c`,
which adjusts values <120 to meet this minimum.

Signed-off-by: Lyall Beveridge <[email protected]>
@morse-lyall morse-lyall force-pushed the validate-dhcp-server-leasetime-input branch from 1032ca1 to 8b3da44 Compare December 9, 2024 00:26
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