mirror of
https://git.openwrt.org/project/ubox.git
synced 2025-12-20 00:52:35 +08:00
ubox validate: port range check fix
The luci GUI allows a single port in a port range field. This additional check validates a single port if a range was not found. Signed-off-by: Paul Donald <newtwen+github@gmail.com> Link: https://github.com/openwrt/ubox/pull/7 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
committed by
Robert Marko
parent
c75525a58a
commit
6f78fa496b
@@ -597,8 +597,10 @@ dt_type_portrange(struct dt_state *s, int nargs)
|
||||
|
||||
n = strtoul(s->value, &e, 10);
|
||||
|
||||
if (e == s->value || *e != '-')
|
||||
return false;
|
||||
if (e == s->value || *e != '-') {
|
||||
// If parsing as portrange fails, try parsing as a single port
|
||||
return dt_type_port(s, nargs);
|
||||
}
|
||||
|
||||
m = strtoul(e + 1, &e, 10);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user