|
Lines 857-862
ssh_init_forwarding(void)
Link Here
|
| 857 |
"forwarding."); |
857 |
"forwarding."); |
| 858 |
} |
858 |
} |
| 859 |
} |
859 |
} |
|
|
860 |
|
| 861 |
/* Initiate tunnel forwarding. */ |
| 862 |
if (options.tun_open != SSH_TUNMODE_NO) { |
| 863 |
if (client_request_tun_fwd(options.tun_open, |
| 864 |
options.tun_local, options.tun_remote) < 0) { |
| 865 |
if (options.exit_on_forward_failure) |
| 866 |
fatal("Could not request tunnel forwarding."); |
| 867 |
else |
| 868 |
error("Could not request tunnel forwarding."); |
| 869 |
} |
| 870 |
} |
| 860 |
} |
871 |
} |
| 861 |
|
872 |
|
| 862 |
static void |
873 |
static void |
|
Lines 1119-1151
ssh_session2_setup(int id, void *arg)
Link Here
|
| 1119 |
packet_send(); |
1130 |
packet_send(); |
| 1120 |
} |
1131 |
} |
| 1121 |
|
1132 |
|
| 1122 |
if (options.tun_open != SSH_TUNMODE_NO) { |
|
|
| 1123 |
Channel *c; |
| 1124 |
int fd; |
| 1125 |
|
| 1126 |
debug("Requesting tun."); |
| 1127 |
if ((fd = tun_open(options.tun_local, |
| 1128 |
options.tun_open)) >= 0) { |
| 1129 |
c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, |
| 1130 |
CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, |
| 1131 |
0, "tun", 1); |
| 1132 |
c->datagram = 1; |
| 1133 |
#if defined(SSH_TUN_FILTER) |
| 1134 |
if (options.tun_open == SSH_TUNMODE_POINTOPOINT) |
| 1135 |
channel_register_filter(c->self, sys_tun_infilter, |
| 1136 |
sys_tun_outfilter); |
| 1137 |
#endif |
| 1138 |
packet_start(SSH2_MSG_CHANNEL_OPEN); |
| 1139 |
packet_put_cstring("tun@openssh.com"); |
| 1140 |
packet_put_int(c->self); |
| 1141 |
packet_put_int(c->local_window_max); |
| 1142 |
packet_put_int(c->local_maxpacket); |
| 1143 |
packet_put_int(options.tun_open); |
| 1144 |
packet_put_int(options.tun_remote); |
| 1145 |
packet_send(); |
| 1146 |
} |
| 1147 |
} |
| 1148 |
|
| 1149 |
client_session2_setup(id, tty_flag, subsystem_flag, getenv("TERM"), |
1133 |
client_session2_setup(id, tty_flag, subsystem_flag, getenv("TERM"), |
| 1150 |
NULL, fileno(stdin), &command, environ, &ssh_subsystem_reply); |
1134 |
NULL, fileno(stdin), &command, environ, &ssh_subsystem_reply); |
| 1151 |
|
1135 |
|
|
Lines 1205-1211
ssh_session2(void)
Link Here
|
| 1205 |
|
1189 |
|
| 1206 |
/* XXX should be pre-session */ |
1190 |
/* XXX should be pre-session */ |
| 1207 |
ssh_init_forwarding(); |
1191 |
ssh_init_forwarding(); |
| 1208 |
ssh_control_listener(); |
|
|
| 1209 |
|
1192 |
|
| 1210 |
if (!no_shell_flag || (datafellows & SSH_BUG_DUMMYCHAN)) |
1193 |
if (!no_shell_flag || (datafellows & SSH_BUG_DUMMYCHAN)) |
| 1211 |
id = ssh_session2_open(); |
1194 |
id = ssh_session2_open(); |
|
Lines 1214-1219
ssh_session2(void)
Link Here
|
| 1214 |
if (options.local_command != NULL && |
1197 |
if (options.local_command != NULL && |
| 1215 |
options.permit_local_command) |
1198 |
options.permit_local_command) |
| 1216 |
ssh_local_cmd(options.local_command); |
1199 |
ssh_local_cmd(options.local_command); |
|
|
1200 |
|
| 1201 |
/* Start listening for multiplex clients */ |
| 1202 |
ssh_control_listener(); |
| 1217 |
|
1203 |
|
| 1218 |
/* If requested, let ssh continue in the background. */ |
1204 |
/* If requested, let ssh continue in the background. */ |
| 1219 |
if (fork_after_authentication_flag) |
1205 |
if (fork_after_authentication_flag) |