Commit 08dcff04 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Impose limits on intervals.

parent fc88b140
...@@ -146,22 +146,23 @@ main(int argc, char **argv) ...@@ -146,22 +146,23 @@ main(int argc, char **argv)
} else if(strcmp(*arg, "-h") == 0) { } else if(strcmp(*arg, "-h") == 0) {
SHIFTE(); SHIFTE();
wireless_hello_interval = parse_msec(*arg); wireless_hello_interval = parse_msec(*arg);
if(wireless_hello_interval <= 0) if(wireless_hello_interval <= 0 ||
wireless_hello_interval > 0xFFFF * 10)
goto syntax; goto syntax;
} else if(strcmp(*arg, "-H") == 0) { } else if(strcmp(*arg, "-H") == 0) {
SHIFTE(); SHIFTE();
wired_hello_interval = parse_msec(*arg); wired_hello_interval = parse_msec(*arg);
if(wired_hello_interval <= 0) if(wired_hello_interval <= 0 || wired_hello_interval > 0xFFFF * 10)
goto syntax; goto syntax;
} else if(strcmp(*arg, "-i") == 0) { } else if(strcmp(*arg, "-i") == 0) {
SHIFTE(); SHIFTE();
idle_hello_interval = parse_msec(*arg); idle_hello_interval = parse_msec(*arg);
if(idle_hello_interval <= 0) if(idle_hello_interval <= 0 || idle_hello_interval > 0xFFFF * 10)
goto syntax; goto syntax;
} else if(strcmp(*arg, "-u") == 0) { } else if(strcmp(*arg, "-u") == 0) {
SHIFTE(); SHIFTE();
update_interval = parse_msec(*arg); update_interval = parse_msec(*arg);
if(update_interval <= 0) if(update_interval <= 0 || update_interval > 0xFFFF * 10)
goto syntax; goto syntax;
} else if(strcmp(*arg, "-k") == 0) { } else if(strcmp(*arg, "-k") == 0) {
SHIFTE(); SHIFTE();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment