version 1.82, 2020/04/30 17:12:20 |
version 1.83, 2020/07/05 23:59:45 |
|
|
{ 0, NULL } |
{ 0, NULL } |
}; |
}; |
|
|
/* Cleanup callback fired on closure of mux slave _session_ channel */ |
/* Cleanup callback fired on closure of mux client _session_ channel */ |
/* ARGSUSED */ |
/* ARGSUSED */ |
static void |
static void |
mux_master_session_cleanup_cb(struct ssh *ssh, int cid, void *unused) |
mux_master_session_cleanup_cb(struct ssh *ssh, int cid, void *unused) |
|
|
channel_cancel_cleanup(ssh, c->self); |
channel_cancel_cleanup(ssh, c->self); |
} |
} |
|
|
/* Cleanup callback fired on closure of mux slave _control_ channel */ |
/* Cleanup callback fired on closure of mux client _control_ channel */ |
/* ARGSUSED */ |
/* ARGSUSED */ |
static void |
static void |
mux_master_control_cleanup_cb(struct ssh *ssh, int cid, void *unused) |
mux_master_control_cleanup_cb(struct ssh *ssh, int cid, void *unused) |
|
|
"(expected %u)", __func__, ver, SSHMUX_VER); |
"(expected %u)", __func__, ver, SSHMUX_VER); |
return -1; |
return -1; |
} |
} |
debug2("%s: channel %d slave version %u", __func__, c->self, ver); |
debug2("%s: channel %d client version %u", __func__, c->self, ver); |
|
|
/* No extensions are presently defined */ |
/* No extensions are presently defined */ |
while (sshbuf_len(m) > 0) { |
while (sshbuf_len(m) > 0) { |
|
|
/* Gather fds from client */ |
/* Gather fds from client */ |
for(i = 0; i < 3; i++) { |
for(i = 0; i < 3; i++) { |
if ((new_fd[i] = mm_receive_fd(c->sock)) == -1) { |
if ((new_fd[i] = mm_receive_fd(c->sock)) == -1) { |
error("%s: failed to receive fd %d from slave", |
error("%s: failed to receive fd %d from client", |
__func__, i); |
__func__, i); |
for (j = 0; j < i; j++) |
for (j = 0; j < i; j++) |
close(new_fd[j]); |
close(new_fd[j]); |
|
|
/* Gather fds from client */ |
/* Gather fds from client */ |
for(i = 0; i < 2; i++) { |
for(i = 0; i < 2; i++) { |
if ((new_fd[i] = mm_receive_fd(c->sock)) == -1) { |
if ((new_fd[i] = mm_receive_fd(c->sock)) == -1) { |
error("%s: failed to receive fd %d from slave", |
error("%s: failed to receive fd %d from client", |
__func__, i); |
__func__, i); |
for (j = 0; j < i; j++) |
for (j = 0; j < i; j++) |
close(new_fd[j]); |
close(new_fd[j]); |
|
|
return 0; |
return 0; |
} |
} |
|
|
/* Channel callbacks fired on read/write from mux slave fd */ |
/* Channel callbacks fired on read/write from mux client fd */ |
static int |
static int |
mux_master_read_cb(struct ssh *ssh, Channel *c) |
mux_master_read_cb(struct ssh *ssh, Channel *c) |
{ |
{ |