diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: ssh.c,v 1.255 2005/12/06 22:38:27 reyk Exp $"); | 43 | RCSID("$OpenBSD: ssh.c,v 1.256 2005/12/08 18:34:11 reyk Exp $"); |
44 | 44 | ||
45 | #include <openssl/evp.h> | 45 | #include <openssl/evp.h> |
46 | #include <openssl/err.h> | 46 | #include <openssl/err.h> |
@@ -341,9 +341,10 @@ again: | |||
341 | exit(0); | 341 | exit(0); |
342 | break; | 342 | break; |
343 | case 'w': | 343 | case 'w': |
344 | options.tun_open = 1; | 344 | if (options.tun_open == -1) |
345 | options.tun_open = SSH_TUNMODE_DEFAULT; | ||
345 | options.tun_local = a2tun(optarg, &options.tun_remote); | 346 | options.tun_local = a2tun(optarg, &options.tun_remote); |
346 | if (options.tun_local < -1) { | 347 | if (options.tun_local == SSH_TUNID_ERR) { |
347 | fprintf(stderr, "Bad tun device '%s'\n", optarg); | 348 | fprintf(stderr, "Bad tun device '%s'\n", optarg); |
348 | exit(1); | 349 | exit(1); |
349 | } | 350 | } |
@@ -1067,12 +1068,13 @@ ssh_session2_setup(int id, void *arg) | |||
1067 | packet_send(); | 1068 | packet_send(); |
1068 | } | 1069 | } |
1069 | 1070 | ||
1070 | if (options.tun_open) { | 1071 | if (options.tun_open != SSH_TUNMODE_NO) { |
1071 | Channel *c; | 1072 | Channel *c; |
1072 | int fd; | 1073 | int fd; |
1073 | 1074 | ||
1074 | debug("Requesting tun."); | 1075 | debug("Requesting tun."); |
1075 | if ((fd = tun_open(options.tun_local)) >= 0) { | 1076 | if ((fd = tun_open(options.tun_local, |
1077 | options.tun_open)) >= 0) { | ||
1076 | c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, | 1078 | c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, |
1077 | CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, | 1079 | CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, |
1078 | 0, "tun", 1); | 1080 | 0, "tun", 1); |
@@ -1082,6 +1084,7 @@ ssh_session2_setup(int id, void *arg) | |||
1082 | packet_put_int(c->self); | 1084 | packet_put_int(c->self); |
1083 | packet_put_int(c->local_window_max); | 1085 | packet_put_int(c->local_window_max); |
1084 | packet_put_int(c->local_maxpacket); | 1086 | packet_put_int(c->local_maxpacket); |
1087 | packet_put_int(options.tun_open); | ||
1085 | packet_put_int(options.tun_remote); | 1088 | packet_put_int(options.tun_remote); |
1086 | packet_send(); | 1089 | packet_send(); |
1087 | } | 1090 | } |