comparison cli-runopts.c @ 1834:94dc11094e26

Increase max window size to 10MB, fallback rather than exiting if an invalid value is given.
author Matt Johnston <matt@codeconstruct.com.au>
date Tue, 12 Oct 2021 23:32:10 +0800
parents df8d8ec1801c
children 33363a68784d
comparison
equal deleted inserted replaced
1833:870f6e386a0b 1834:94dc11094e26
77 "-g Allow remote hosts to connect to forwarded ports\n" 77 "-g Allow remote hosts to connect to forwarded ports\n"
78 #endif 78 #endif
79 #if DROPBEAR_CLI_REMOTETCPFWD 79 #if DROPBEAR_CLI_REMOTETCPFWD
80 "-R <[listenaddress:]listenport:remotehost:remoteport> Remote port forwarding\n" 80 "-R <[listenaddress:]listenport:remotehost:remoteport> Remote port forwarding\n"
81 #endif 81 #endif
82 "-W <receive_window_buffer> (default %d, larger may be faster, max 1MB)\n" 82 "-W <receive_window_buffer> (default %d, larger may be faster, max 10MB)\n"
83 "-K <keepalive> (0 is never, default %d)\n" 83 "-K <keepalive> (0 is never, default %d)\n"
84 "-I <idle_timeout> (0 is never, default %d)\n" 84 "-I <idle_timeout> (0 is never, default %d)\n"
85 #if DROPBEAR_CLI_NETCAT 85 #if DROPBEAR_CLI_NETCAT
86 "-B <endhost:endport> Netcat-alike forwarding\n" 86 "-B <endhost:endport> Netcat-alike forwarding\n"
87 #endif 87 #endif
449 449
450 if (cli_opts.backgrounded && cli_opts.cmd == NULL 450 if (cli_opts.backgrounded && cli_opts.cmd == NULL
451 && cli_opts.no_cmd == 0) { 451 && cli_opts.no_cmd == 0) {
452 dropbear_exit("Command required for -f"); 452 dropbear_exit("Command required for -f");
453 } 453 }
454 454
455 if (recv_window_arg) { 455 if (recv_window_arg) {
456 opts.recv_window = atol(recv_window_arg); 456 parse_recv_window(recv_window_arg);
457 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) {
458 dropbear_exit("Bad recv window '%s'", recv_window_arg);
459 }
460 } 457 }
461 if (keepalive_arg) { 458 if (keepalive_arg) {
462 unsigned int val; 459 unsigned int val;
463 if (m_str_to_uint(keepalive_arg, &val) == DROPBEAR_FAILURE) { 460 if (m_str_to_uint(keepalive_arg, &val) == DROPBEAR_FAILURE) {
464 dropbear_exit("Bad keepalive '%s'", keepalive_arg); 461 dropbear_exit("Bad keepalive '%s'", keepalive_arg);