summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authorstevesk <stevesk@openbsd.org>2008-11-01 17:40:33 +0000
committerstevesk <stevesk@openbsd.org>2008-11-01 17:40:33 +0000
commitd0bf1f9583864a82f0c7d3ce0b1ec9fcf51070fa (patch)
treee438ce0323297ee994816c74471050194bfcf69f /usr.bin/ssh/ssh.c
parentIntroduced Uniform Model for TTL handling. (diff)
downloadwireguard-openbsd-d0bf1f9583864a82f0c7d3ce0b1ec9fcf51070fa.tar.xz
wireguard-openbsd-d0bf1f9583864a82f0c7d3ce0b1ec9fcf51070fa.zip
merge dynamic forward parsing into parse_forward(); 'i think this is OK' djm@
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index eb131bc1e01..a20d156bbe7 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.321 2008/10/09 06:54:22 jmc Exp $ */
+/* $OpenBSD: ssh.c,v 1.322 2008/11/01 17:40:33 stevesk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -440,7 +440,7 @@ main(int ac, char **av)
break;
case 'L':
- if (parse_forward(&fwd, optarg))
+ if (parse_forward(&fwd, optarg, 0))
add_local_forward(&options, &fwd);
else {
fprintf(stderr,
@@ -451,7 +451,7 @@ main(int ac, char **av)
break;
case 'R':
- if (parse_forward(&fwd, optarg)) {
+ if (parse_forward(&fwd, optarg, 0)) {
add_remote_forward(&options, &fwd);
} else {
fprintf(stderr,
@@ -462,30 +462,14 @@ main(int ac, char **av)
break;
case 'D':
- cp = p = xstrdup(optarg);
- memset(&fwd, '\0', sizeof(fwd));
- fwd.connect_host = "socks";
- if ((fwd.listen_host = hpdelim(&cp)) == NULL) {
- fprintf(stderr, "Bad dynamic forwarding "
- "specification '%.100s'\n", optarg);
- exit(255);
- }
- if (cp != NULL) {
- fwd.listen_port = a2port(cp);
- fwd.listen_host =
- cleanhostname(fwd.listen_host);
+ if (parse_forward(&fwd, optarg, 1)) {
+ add_local_forward(&options, &fwd);
} else {
- fwd.listen_port = a2port(fwd.listen_host);
- fwd.listen_host = NULL;
- }
-
- if (fwd.listen_port == 0) {
- fprintf(stderr, "Bad dynamic port '%s'\n",
- optarg);
+ fprintf(stderr,
+ "Bad dynamic forwarding specification "
+ "'%s'\n", optarg);
exit(255);
}
- add_local_forward(&options, &fwd);
- xfree(p);
break;
case 'C':