comparison common-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 f8d8af12ac14
children 8b4274d34fe8
comparison
equal deleted inserted replaced
1833:870f6e386a0b 1834:94dc11094e26
99 99
100 void print_version() { 100 void print_version() {
101 fprintf(stderr, "Dropbear v%s\n", DROPBEAR_VERSION); 101 fprintf(stderr, "Dropbear v%s\n", DROPBEAR_VERSION);
102 } 102 }
103 103
104 void parse_recv_window(const char* recv_window_arg) {
105 int ret;
106 unsigned int rw;
104 107
108 ret = m_str_to_uint(recv_window_arg, &rw);
109 if (ret == DROPBEAR_FAILURE || rw == 0 || rw > MAX_RECV_WINDOW) {
110 if (rw > MAX_RECV_WINDOW) {
111 opts.recv_window = MAX_RECV_WINDOW;
112 }
113 dropbear_log(LOG_WARNING, "Bad recv window '%s', using %d",
114 recv_window_arg, opts.recv_window);
115 } else {
116 opts.recv_window = rw;
117 }
118
119 }
120