version 1.354, 2016/09/30 09:19:13 |
version 1.355, 2016/09/30 20:24:46 |
|
|
char *ctype = NULL, *listen_host = NULL; |
char *ctype = NULL, *listen_host = NULL; |
u_char type; |
u_char type; |
size_t have; |
size_t have; |
int ret = -1, r, id, remote_id, listen_port, idx; |
int ret = -1, r, idx; |
|
u_int id, remote_id, listen_port; |
|
|
/* sshbuf_dump(&downstream->input, stderr); */ |
/* sshbuf_dump(&downstream->input, stderr); */ |
if ((r = sshbuf_get_string_direct(&downstream->input, &cp, &have)) |
if ((r = sshbuf_get_string_direct(&downstream->input, &cp, &have)) |
|
|
error("%s: parse error %s", __func__, ssh_err(r)); |
error("%s: parse error %s", __func__, ssh_err(r)); |
goto out; |
goto out; |
} |
} |
|
if (listen_port > 65535) { |
|
error("%s: tcpip-forward for %s: bad port %u", |
|
__func__, listen_host, listen_port); |
|
goto out; |
|
} |
/* Record that connection to this host/port is permitted. */ |
/* Record that connection to this host/port is permitted. */ |
permitted_opens = xreallocarray(permitted_opens, |
permitted_opens = xreallocarray(permitted_opens, |
num_permitted_opens + 1, sizeof(*permitted_opens)); |
num_permitted_opens + 1, sizeof(*permitted_opens)); |
|
|
permitted_opens[idx].host_to_connect = xstrdup("<mux>"); |
permitted_opens[idx].host_to_connect = xstrdup("<mux>"); |
permitted_opens[idx].port_to_connect = -1; |
permitted_opens[idx].port_to_connect = -1; |
permitted_opens[idx].listen_host = listen_host; |
permitted_opens[idx].listen_host = listen_host; |
permitted_opens[idx].listen_port = listen_port; |
permitted_opens[idx].listen_port = (int)listen_port; |
permitted_opens[idx].downstream = downstream; |
permitted_opens[idx].downstream = downstream; |
listen_host = NULL; |
listen_host = NULL; |
break; |
break; |